VOS::RemoteSocketSiteExtension Class Reference
[libvos]
#include <vos/vos/remotesocketsite.hh>
Inheritance diagram for VOS::RemoteSocketSiteExtension:

Detailed Description
Extends a remote site to support communication over a TCP/IP socket.
Definition at line 17 of file remotesocketsite.hh.
Public Member Functions
- RemoteSocketSiteExtension (int socket, sockaddr_in *peername)
- RemoteSocketSiteExtension (const std::string &hostname, unsigned short int port)
- virtual ~RemoteSocketSiteExtension ()
- virtual void siteExtensionAttachedTo (Site *st)
- VUtil::vRef< Site > getRemoteSite ()
- int getSocket ()
- bool needWriteFlush ()
- int readStream (char *data, unsigned int datasize)
- int writeStream (const char *data, unsigned int datasize)
- void handleDisconnection ()
- virtual std::list< VUtil::vRef<
MessageBlock > > readQueuedMessages (bool block) - void pushOutgoingBuffer (const char *newdata=0, unsigned int newsize=0)
- virtual void doSendMessage (VobjectState &state, Message *m)
- virtual void doSendMessage (VobjectState &state, MessageBlock *m)
- virtual bool isConnected ()
Constructor & Destructor Documentation
| VOS::RemoteSocketSiteExtension::RemoteSocketSiteExtension | ( | int | socket, | |
| sockaddr_in * | peername | |||
| ) |
Initialize the site extension with an existing connection.
- Parameters:
-
socket the socket file descriptor peername the socket address info about the connected peer
| VOS::RemoteSocketSiteExtension::RemoteSocketSiteExtension | ( | const std::string & | hostname, | |
| unsigned short int | port | |||
| ) |
Make an outgoing connection to the supplied hostname, on the supplied port.
- Exceptions:
-
NoSuchSiteError if the connection could not be made
| virtual VOS::RemoteSocketSiteExtension::~RemoteSocketSiteExtension | ( | ) | [virtual] |
Destructor.
Member Function Documentation
| virtual void VOS::RemoteSocketSiteExtension::doSendMessage | ( | VobjectState & | state, | |
| MessageBlock * | m | |||
| ) | [virtual] |
Actually send a message block to the socket.
- Parameters:
-
state the vobjectstate for the site object. not used. m the message block
Reimplemented from VOS::SiteExtension.
| virtual void VOS::RemoteSocketSiteExtension::doSendMessage | ( | VobjectState & | state, | |
| Message * | m | |||
| ) | [virtual] |
Actually send a message to the socket.
- Parameters:
-
state the vobjectstate for the site object. not used. m the message
Reimplemented from VOS::SiteExtension.
| VUtil::vRef<Site> VOS::RemoteSocketSiteExtension::getRemoteSite | ( | ) | [inline] |
- Returns:
- the remote site this extension is attached to
Definition at line 49 of file remotesocketsite.hh.
| int VOS::RemoteSocketSiteExtension::getSocket | ( | ) | [inline] |
| void VOS::RemoteSocketSiteExtension::handleDisconnection | ( | ) |
Cleans up after the socket disconnects.
| virtual bool VOS::RemoteSocketSiteExtension::isConnected | ( | ) | [virtual] |
Implements VOS::RemoteSiteExtension.
| bool VOS::RemoteSocketSiteExtension::needWriteFlush | ( | ) | [inline] |
- Returns:
- true if there is buffered data that is waiting to be sent
Definition at line 55 of file remotesocketsite.hh.
| void VOS::RemoteSocketSiteExtension::pushOutgoingBuffer | ( | const char * | newdata = 0, |
|
| unsigned int | newsize = 0 | |||
| ) |
Writes data to the socket until it has flushed the outgoing data buffer or gets EWOULDBLOCK (indicating that operating system socket buffers are full).
- Parameters:
-
newdata data to send; will be appended to any old data still in the output buffer newsize the size of the data to send
| virtual std::list< VUtil::vRef<MessageBlock> > VOS::RemoteSocketSiteExtension::readQueuedMessages | ( | bool | block | ) | [virtual] |
Reads and parses any messages pending on the socket.
- Returns:
- a list of messages/message blocks
Implements VOS::RemoteSiteExtension.
| int VOS::RemoteSocketSiteExtension::readStream | ( | char * | data, | |
| unsigned int | datasize | |||
| ) |
- Parameters:
-
data the buffer to store the data read from the socket datasize the maximum number of bytes to read
- Returns:
- the number of bytes actually read
| virtual void VOS::RemoteSocketSiteExtension::siteExtensionAttachedTo | ( | Site * | st | ) | [virtual] |
| int VOS::RemoteSocketSiteExtension::writeStream | ( | const char * | data, | |
| unsigned int | datasize | |||
| ) |
- Parameters:
-
data the buffer to be written to the socket datasize the number of bytes to be written
- Returns:
- the actual number of bytes that were written
The documentation for this class was generated from the following file:
- /home/tetron/hack/vos/libs/vos/vos/remotesocketsite.hh