Added TCP server functionality

Fixed a bunch of leaks + race conditions
Still in development, hence all the printfs
This commit is contained in:
BotoX
2017-01-08 16:36:28 +01:00
parent 53cc45e7e1
commit 7b10708a20
8 changed files with 471 additions and 137 deletions
+9 -3
View File
@@ -12,6 +12,11 @@ public:
IPluginContext *m_pContext;
Handle_t m_Handle;
bool m_Deleted;
bool m_PendingCallback;
bool m_Pending;
bool m_Server;
char *m_pHost;
int m_Port;
@@ -19,14 +24,15 @@ public:
IChangeableForward *m_pErrorCallback;
IChangeableForward *m_pDataCallback;
uv_getaddrinfo_t resolver;
uv_tcp_t *socket;
uv_stream_t *stream;
uv_getaddrinfo_t m_Resolver;
uv_tcp_t *m_pSocket;
uv_stream_t *m_pStream;
CAsyncSocketContext(IPluginContext *plugin);
~CAsyncSocketContext();
void Connected();
void OnConnect(CAsyncSocketContext *pSocketContext);
void OnError(int error);