-
-
Save creationix/c5c3020829bb94f2919a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef LUV_TCP_H | |
#define LUV_TCP_H | |
#include "candor.h" | |
using namespace candor; | |
namespace candorIO { | |
class uvTcp : public CWrapper { | |
uv_tcp_t handle; | |
Handle<Function> onConnect; | |
Handle<Function> onShutdown; | |
Handle<Function> onConnection; | |
Handle<Function> onRead; | |
Handle<Function> onClose; | |
public: | |
uvTcp(); | |
// Tcp methods | |
Value* Nodelay(uint32_t argc, Arguments& argv); | |
Value* Keepalive(uint32_t argc, Arguments& argv); | |
Value* Bind(uint32_t argc, Arguments& argv); | |
Value* Getsockname(uint32_t argc, Arguments& argv); | |
Value* Getpeername(uint32_t argc, Arguments& argv); | |
void OnConnect(); | |
Value* Connect(uint32_t argc, Arguments& argv); | |
// Stream methods | |
void* OnShutdown(); | |
Value* Shutdown(uint32_t argc, Arguments& argv); | |
void OnConnection(); | |
Value* Listen(uint32_t argc, Arguments& argv); | |
Value* Accept(uint32_t argc, Arguments& argv); | |
void OnRead(); | |
Value* ReadStart(uint32_t argc, Arguments& argv); | |
Value* ReadStop(uint32_t argc, Arguments& argv); | |
void OnWrite(); | |
Value* Write(uint32_t argc, Arguments& argv); | |
Value* IsReadable(uint32_t argc, Arguments& argv); | |
Value* IsWritable(uint32_t argc, Arguments& argv); | |
// Handle methods | |
void OnClose(); | |
Value* Close(uint32_t argc, Arguments& argv); | |
}; | |
} | |
void luv_tcp_init(Object* uv); | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment