-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsocket.h
More file actions
26 lines (22 loc) · 920 Bytes
/
socket.h
File metadata and controls
26 lines (22 loc) · 920 Bytes
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
#ifndef _SOCKET_H
#define _SOCKET_H
struct _Socket;
typedef struct _Socket Socket;
int socketAccept(const Socket* sock, Socket* conn);
int socketBind(Socket* sock);
int socketConnect(const Socket* sock);
int socketConnectTo(const char* host, Socket* sock);
int socketClose(Socket* sock);
Socket* socketConstruct(void);
int socketCreate(Socket* sock);
void socketDestroy(Socket* sock);
const char* socketError(const Socket* sock);
int socketListen(const Socket* sock);
int socketRecv(const Socket* sock, void* buffer, unsigned bytes, int flags);
int socketSend(const Socket* sock, const void* buffer, unsigned bytes, int flags);
void socketSetAddress(unsigned int ip4, unsigned short port, Socket* sock);
int socketSetBlocking(int block, Socket* sock);
void socketSetIp(unsigned int ip4, Socket* sock);
int socketSetOptReuse(Socket* sock);
void socketSetPort(unsigned short port, Socket* sock);
#endif /*_SOCKET_H */