24 lines
472 B
C
24 lines
472 B
C
|
//
|
||
|
// Created by nicol on 2018-03-18.
|
||
|
//
|
||
|
|
||
|
#ifndef ESC_SOCKET_H
|
||
|
#define ESC_SOCKET_H
|
||
|
|
||
|
struct st_socket;
|
||
|
typedef struct st_socket* socket_t;
|
||
|
|
||
|
enum {
|
||
|
SOCKET_TYPE_TCP = 1,
|
||
|
SOCKET_TYPE_UDP = 2
|
||
|
};
|
||
|
|
||
|
socket_t socket_create(int type);
|
||
|
void socket_close(socket_t s);
|
||
|
int socket_connect(socket_t s, char* addr, unsigned short port);
|
||
|
int socket_send(socket_t s, char* data, int len);
|
||
|
int socket_recv(socket_t s, char* buf, int len);
|
||
|
int socket_error();
|
||
|
|
||
|
#endif //ESC_SOCKET_H
|