summaryrefslogtreecommitdiff
path: root/libpcsxcore/socket.h
diff options
context:
space:
mode:
authorXavi Del Campo <xavi.dcr@tutanota.com>2020-05-02 02:34:17 +0200
committerXavi Del Campo <xavi.dcr@tutanota.com>2020-05-02 02:34:49 +0200
commit486666e7173a0ed72248329e960ffc03f79b8707 (patch)
tree3484e6b0a58cd55f39467d1506830b54f090f8cd /libpcsxcore/socket.h
parentaecaf18a950fc708823780f2e59303ad63f4e3bd (diff)
downloadpcsxr-486666e7173a0ed72248329e960ffc03f79b8707.tar.gz
Introduced dynstr, other breaking changes
Diffstat (limited to 'libpcsxcore/socket.h')
-rw-r--r--libpcsxcore/socket.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/libpcsxcore/socket.h b/libpcsxcore/socket.h
index ef26de02..10d3c2fe 100644
--- a/libpcsxcore/socket.h
+++ b/libpcsxcore/socket.h
@@ -22,17 +22,27 @@
extern "C" {
#endif
+#include <stddef.h>
+
+enum read_socket_err
+{
+ READ_SOCKET_OK,
+ READ_SOCKET_ERR_INVALID_ARG,
+ READ_SOCKET_ERR_RECV,
+ READ_SOCKET_SHUTDOWN
+};
+
int StartServer(unsigned short port);
void StopServer(int s_socket);
-void GetClient(int s_socket, int *client_socket);
-void CloseClient(int *client_socket);
+int GetClient(int s_socket);
+void CloseClient(int client_socket);
int HasClient(int client_socket);
-int ReadSocket(int *client_socket, char * buffer, int len);
-int RawReadSocket(int *client_socket, char * buffer, int len);
-void WriteSocket(int *client_socket, char * buffer, int len);
+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 char *buffer, size_t len);
void SetsBlock(int s_socket);
void SetsNonblock(int s_socket);