move utils into subfolder
manager thread (wip)
This commit is contained in:
23
src/utils/socket.h
Normal file
23
src/utils/socket.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// 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);
|
||||
ssize_t socket_send(socket_t s, char* data, size_t len);
|
||||
ssize_t socket_recv(socket_t s, char* buf, size_t len);
|
||||
int socket_error();
|
||||
|
||||
#endif //ESC_SOCKET_H
|
||||
Reference in New Issue
Block a user