My Project
|
Public Member Functions | |
NetHandler () | |
NetHandler (int fd) | |
virtual | ~NetHandler () |
void | attachReadStream (int fd) |
void | attachSendStream (int fd) |
void | attach (int fd) |
virtual int | getReadFd () |
virtual int | getSendFd () |
virtual int | getFd () |
void | setReadBuffer (void *buffer, unsigned int size) |
void | setSendBuffer (void *buffer, unsigned int size) |
gcp::util::NetSendStr::NetSendId | send () |
gcp::util::NetSendStr::NetSendId | send (int fd) |
gcp::util::NetReadStr::NetReadId | read () |
gcp::util::NetReadStr::NetReadId | read (int fd) |
NetReadStr * | getReadStr () |
NetSendStr * | getSendStr () |
virtual void | installReadHandler (NET_READ_HANDLER(*handler), void *arg) |
virtual void | installReadErrorHandler (NET_ERROR_HANDLER(*handler), void *arg) |
virtual void | installSendHandler (NET_SEND_HANDLER(*handler), void *arg) |
virtual void | installSendErrorHandler (NET_ERROR_HANDLER(*handler), void *arg) |
virtual void | installErrorHandler (NET_ERROR_HANDLER(*handler), void *arg) |
Protected Attributes | |
int | fd_ |
NetReadStr * | nrs_ |
NetSendStr * | nss_ |
NetHandler::NetHandler | ( | ) |
Constructor.
....................................................................... Constructor.
NetHandler::NetHandler | ( | int | fd | ) |
Constructor.
....................................................................... Constructor.
|
virtual |
Destructor.
....................................................................... Destructor.
void NetHandler::attach | ( | int | fd | ) |
Attach all streams to the same socket.
....................................................................... Attach all streams to the same socket.
void NetHandler::attachReadStream | ( | int | fd | ) |
Attach the network I/O stream to a socket.
....................................................................... Attach the network read stream to a socket.
void NetHandler::attachSendStream | ( | int | fd | ) |
Attach the network I/O stream to a socket.
....................................................................... Attach the network send stream to a socket.
|
virtual |
Method for returning a single fd. This will be -1 until the attach() method is used to attach all streams.
....................................................................... Return a single file descriptor to which all streams are attached.
|
virtual |
Overwritable method for returning the read fd.
....................................................................... Return the file descriptor the read stream is attached to.
|
inline |
Return a pointer to our read stream
|
virtual |
Overwritable method for returning the send fd.
....................................................................... Return the file descriptor the send stream is attached to.
|
inline |
Return a pointer to our read stream
|
virtual |
....................................................................... Install the same error handler for both streams
Reimplemented in gcp::util::NetMsgHandler, and gcp::util::NetCmdHandler.
|
virtual |
....................................................................... Methods to install user-defined handlers
|
virtual |
Methods to install user-defined handlers
....................................................................... Methods to install user-defined handlers
Reimplemented in gcp::util::NetMsgHandler, and gcp::util::NetCmdHandler.
|
virtual |
....................................................................... Methods to install user-defined handlers
|
virtual |
....................................................................... Methods to install user-defined handlers
Reimplemented in gcp::util::NetMsgHandler, and gcp::util::NetCmdHandler.
NetReadStr::NetReadId NetHandler::read | ( | ) |
Read a message into our network buffer from a socket described by a previously attached fd.
....................................................................... Read a message packed into our network buffer from a socket described by a previously attached fd.
NetReadStr::NetReadId NetHandler::read | ( | int | fd | ) |
Read a message into our network buffer from the specified socket.
....................................................................... Read a message packed into our network buffer from the specified socket.
NetSendStr::NetSendId NetHandler::send | ( | ) |
Send a message packed into our network buffer to a socket described by a previously attached fd.
....................................................................... Send a message previously packed into our network buffer to a socket described by a previously attached fd.
NetSendStr::NetSendId NetHandler::send | ( | int | fd | ) |
Send a message packed into our network buffer to the specified socket.
....................................................................... Send a message packed into our network buffer to the specified socket.
void NetHandler::setReadBuffer | ( | void * | buffer, |
unsigned int | size | ||
) |
Set the network buffer pointing to an external buffer, or pass buffer=NULL to dynamically allocate it.
....................................................................... Set the network buffer pointing to an external buffer, or pass buffer=NULL to dynamically allocate it.
void NetHandler::setSendBuffer | ( | void * | buffer, |
unsigned int | size | ||
) |
Set the network buffer pointing to an external buffer, or pass buffer=NULL to dynamically allocate it.
....................................................................... Set the network buffer pointing to an external buffer, or pass buffer=NULL to dynamically allocate it.