#include <OSGStreamSockConnection.h>
Inheritance diagram for osg::StreamSockConnection:


Public Types | |
| typedef Connection | Inherited |
| typedef std::vector< StreamSocket > | SocketsT |
| typedef std::vector< UInt8 > | SocketBufferT |
Public Methods | |
Constructor | |
| StreamSockConnection () | |
| Constructor. | |
Destructor | |
| virtual | ~StreamSockConnection (void) |
| Destructor. | |
Communication | |
| string | bind (const string &address) |
| Bind connection to the givven address. | |
| void | accept (void) |
| Wait for incommint connections on the bound port. | |
| void | connect (const string &address) |
| connect a connection at the given address | |
| void | wait (void) |
| wait for sync signal | |
| void | signal (void) |
| send synchronisaiton signale | |
| UInt32 | getChannelCount (void) |
| get number of links | |
| void | selectChannel (void) |
| select channel for read | |
| const ConnectionType * | getType (void) |
| Get type of connection. | |
Static Public Methods | |
create | |
| Connection * | create (void) |
| create conneciton | |
Protected Methods | |
IO Implementation | |
| virtual void | read (MemoryHandle mem, UInt32 size) |
| Read data into given memory. | |
| virtual void | readBuffer () |
| Read next data block. | |
| virtual void | write (MemoryHandle mem, UInt32 size) |
| Write data to all destinations. | |
| virtual void | writeBuffer () |
| Write buffer. | |
| void | interpreteAddress (const string &address, string &host, UInt32 &port) |
| Interprete an address string. | |
Protected Attributes | |
Instance Variables | |
| StreamSocket | _acceptSocket |
| StreamSocket | _readSocket |
| SocketsT | _sockets |
| std::vector< UInt8 > | _socketReadBuffer |
| std::vector< UInt8 > | _socketWriteBuffer |
Private Methods | |
Copy | |
| StreamSockConnection (const StreamSockConnection &source) | |
| StreamSockConnection & | operator= (const StreamSockConnection &source) |
Static Private Attributes | |
Class Variable | |
| char | cvsid [] = "@(#)$Id:$" |
| ConnectionType | _type |
Connect:
StreamSockConnection con; con.connect( "dagobert:3333" ); con.connect( "donald:3333" ); con.connect( "tric:3333" ); con.putUInt32(1234); con.flush();
Accept:
StreamSockConnection con;
con.bind("3333");
con.accept();
con.selectChannel();
UInt32 x;
con.getUInt32(x);
|
|
Reimplemented from osg::Connection. |
|
|
|
|
|
|
|
|
Constructor. Initialize a StreamSockConnection. By default a buffer of 16000 bytes is used. |
|
|
Destructor.
|
|
|
|
|
|
Bind connection to the givven address.
Implements osg::Connection. |
|
|
Wait for incommint connections on the bound port.
Implements osg::Connection. |
|
|
connect a connection at the given address
Implements osg::Connection. |
|
|
wait for sync signal
Implements osg::Connection. |
|
|
send synchronisaiton signale
Implements osg::Connection. |
|
|
get number of links
Implements osg::Connection. |
|
|
select channel for read A connection can have n links from which data can be read. So we need to select one channel for exclusive read. Implements osg::Connection. |
|
|
Get type of connection.
Implements osg::Connection. |
|
|
create conneciton
|
|
||||||||||||
|
Read data into given memory. Read data form the current read socket. The read socket is that socket, that was selectet in selectChannel. Reimplemented from osg::BinaryDataHandler. |
|
|
Read next data block. The stream connection uses only BinaryDataHandler buffer. If more then one buffer is present, then this methode must be changed! Reimplemented from osg::BinaryDataHandler. |
|
||||||||||||
|
Write data to all destinations.
Reimplemented from osg::BinaryDataHandler. |
|
|
Write buffer. Write blocksize and data. Reimplemented from osg::BinaryDataHandler. |
|
||||||||||||||||
|
Interprete an address string. Hoststring syntax is host:port or :port or port
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2.16