diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2020-06-04 23:47:45 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2020-06-04 23:47:45 +0200 |
| commit | 0521d579639d32587fb8f65eb28a29d3b63be88b (patch) | |
| tree | 1b0da4268222ff9a67d61ea6de9bf2bc3ae01c48 /libpcsxcore/socket.h | |
| parent | 85141ac554d346cd47041a51f6e828a121c568d2 (diff) | |
| parent | 66d4b1aff798e2890b2bf355d7c0e3f546a1b06b (diff) | |
| download | pcsxr-0521d579639d32587fb8f65eb28a29d3b63be88b.tar.gz | |
Merge branch 'multisockets'
Diffstat (limited to 'libpcsxcore/socket.h')
| -rw-r--r-- | libpcsxcore/socket.h | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/libpcsxcore/socket.h b/libpcsxcore/socket.h index 7ee0deb4..852c76a4 100644 --- a/libpcsxcore/socket.h +++ b/libpcsxcore/socket.h @@ -22,20 +22,30 @@ extern "C" { #endif -int StartServer(); -void StopServer(); +#include <stddef.h> -void GetClient(); -void CloseClient(); +enum read_socket_err +{ + READ_SOCKET_OK, + READ_SOCKET_ERR_INVALID_ARG, + READ_SOCKET_ERR_RECV, + READ_SOCKET_SHUTDOWN +}; -int HasClient(); +int StartServer(unsigned short port); +void StopServer(int s_socket); -int ReadSocket(char * buffer, int len); -int RawReadSocket(char * buffer, int len); -void WriteSocket(char * buffer, int len); +int GetClient(int s_socket, int blocking); +void CloseClient(int client_socket); -void SetsBlock(); -void SetsNonblock(); +int HasClient(int client_socket); + +enum read_socket_err ReadSocket(int client_socket, char *buffer, size_t *len); +int RawReadSocket(int client_socket, char *buffer, size_t len); +void WriteSocket(int client_socket, const void *buffer, size_t len); + +void SetsBlock(int s_socket); +void SetsNonblock(int s_socket); #ifdef __cplusplus } |
