-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathmbal_tcp.h
37 lines (31 loc) · 1.01 KB
/
mbal_tcp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*********************************************************************
* _ _ _
* _ __ | |_ _ | | __ _ | |__ ___
* | '__|| __|(_)| | / _` || '_ \ / __|
* | | | |_ _ | || (_| || |_) |\__ \
* |_| \__|(_)|_| \__,_||_.__/ |___/
*
* www.rt-labs.com
* Copyright 2015 rt-labs AB, Sweden.
*
* This software is dual-licensed under GPLv3 and a commercial
* license. See the file LICENSE.md distributed with this software for
* full license information.
********************************************************************/
#ifndef MBAL_TCP_H
#define MBAL_TCP_H
#ifdef __cplusplus
extern "C" {
#endif
#include "mbal_sys.h"
#include "mb_transport.h"
int os_tcp_connect (const char * name, uint16_t port);
int os_tcp_accept_connection (uint16_t port);
void os_tcp_close (int peer);
int os_tcp_send (int peer, const void * buffer, size_t size);
int os_tcp_recv (int peer, void * buffer, size_t size);
int os_tcp_recv_wait (int peer, uint32_t tmo);
#ifdef __cplusplus
}
#endif
#endif /* MBAL_TCP_H */