My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::util::NetHandler Class Reference
Inheritance diagram for gcp::util::NetHandler:
gcp::util::NetAntennaDataFrameHandler gcp::util::NetCmdHandler gcp::util::NetDataFrameHandler gcp::util::NetMsgHandler gcp::util::NetTermHandler

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)
 
NetReadStrgetReadStr ()
 
NetSendStrgetSendStr ()
 
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_
 
NetReadStrnrs_
 
NetSendStrnss_
 

Constructor & Destructor Documentation

NetHandler::NetHandler ( )

Constructor.

....................................................................... Constructor.

NetHandler::NetHandler ( int  fd)

Constructor.

....................................................................... Constructor.

NetHandler::~NetHandler ( )
virtual

Destructor.

....................................................................... Destructor.

Member Function Documentation

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.

int NetHandler::getFd ( )
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.

int NetHandler::getReadFd ( )
virtual

Overwritable method for returning the read fd.

....................................................................... Return the file descriptor the read stream is attached to.

NetReadStr* gcp::util::NetHandler::getReadStr ( )
inline

Return a pointer to our read stream

int NetHandler::getSendFd ( )
virtual

Overwritable method for returning the send fd.

....................................................................... Return the file descriptor the send stream is attached to.

NetSendStr* gcp::util::NetHandler::getSendStr ( )
inline

Return a pointer to our read stream

void NetHandler::installErrorHandler ( NET_ERROR_HANDLER *  handler,
void *  arg 
)
virtual

....................................................................... Install the same error handler for both streams

Reimplemented in gcp::util::NetMsgHandler, and gcp::util::NetCmdHandler.

void NetHandler::installReadErrorHandler ( NET_ERROR_HANDLER *  handler,
void *  arg 
)
virtual

....................................................................... Methods to install user-defined handlers

void NetHandler::installReadHandler ( NET_READ_HANDLER *  handler,
void *  arg 
)
virtual

Methods to install user-defined handlers

....................................................................... Methods to install user-defined handlers

Reimplemented in gcp::util::NetMsgHandler, and gcp::util::NetCmdHandler.

void NetHandler::installSendErrorHandler ( NET_ERROR_HANDLER *  handler,
void *  arg 
)
virtual

....................................................................... Methods to install user-defined handlers

void NetHandler::installSendHandler ( NET_SEND_HANDLER *  handler,
void *  arg 
)
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.


The documentation for this class was generated from the following files: