#ifndef ASYNC_SOCKET_CONTEXT_H #define ASYNC_SOCKET_CONTEXT_H #include #include #include "smsdk_ext.h" class AsyncSocketContext { public: IPluginContext* pContext; Handle_t hndl; char* host; int port; IChangeableForward *connectCallback; IChangeableForward *errorCallback; IChangeableForward *dataCallback; uv_getaddrinfo_t resolver; uv_connect_t* connect_req; uv_tcp_t* socket; AsyncSocketContext(IPluginContext* plugin); ~AsyncSocketContext(); void Connected(); void OnError(int error); void OnData(char* data, ssize_t size); bool SetConnectCallback(funcid_t function); bool SetErrorCallback(funcid_t function); bool SetDataCallback(funcid_t function); }; #endif