#include <OSGMulticastConnection.h>
Inheritance diagram for osg::MulticastConnection:


Alive thread handling | |
| void | startAliveThread () |
| Start alive thread. | |
| void | stopAliveThread () |
| Stop alive thread. | |
| BaseThread * | _aliveThread |
| Start alive thread. | |
| bool | _stopAliveThread |
| Start alive thread. | |
| void * | aliveProc (void *arg) |
| Start alive thread. | |
Public Methods | |
Constructors | |
| MulticastConnection (int port=0) | |
| Constructor. | |
Destructor | |
| virtual | ~MulticastConnection (void) |
| Destructor. | |
your_category | |
| string | bind (const string &address) |
| Bind connection to the givven address. | |
| void | accept (void) |
| Wait for incommint connections on the given address. | |
| void | connect (const string &address) |
| connect a connection at the given address | |
| void | wait (void) |
| wait for sync | |
| void | signal (void) |
| send sync | |
| 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 Types | |
| typedef vector< vector< UInt8 > > | UDPBuffersT |
| enum | UDPHeaderType { ACK_REQUEST, ACK, DATA, ALIVE, SYNC, CONNECT, CLOSED } |
Protected Methods | |
read/write | |
| virtual void | readBuffer (void) |
| Write buffer. | |
| virtual void | writeBuffer (void) |
| Write buffer. | |
address handling | |
| void | interpreteAddress (const string &address, string &group, UInt32 &port, UInt32 &member) |
| nterprete address | |
Protected Attributes | |
Member | |
| vector< SocketAddress > | _channelAddress |
| vector< UInt32 > | _channelSeqNumber |
| UInt32 | _channel |
| UInt32 | _seqNumber |
| UDPBuffersT | _udpReadBuffers |
| UDPBuffersT | _udpWriteBuffers |
| Time | _maxWaitForAck |
| Time | _waitForAck |
| Time | _maxWaitForSync |
| DgramSocket | _socket |
| DgramSocket | _inSocket |
| DgramSocket | _groupSocket |
| DgramSocket | _aliveSocket |
| SocketAddress | _destination |
| UInt32 | _member |
| Time | _aliveTime |
Private Types | |
| typedef Connection | Inherited |
Private Methods | |
| MulticastConnection (const MulticastConnection &source) | |
| prohibit default function (move to 'public' if needed) | |
| void | operator= (const MulticastConnection &source) |
Static Private Attributes | |
Class Variable | |
| ConnectionType | _type |
Friends | |
| struct | UDPBuffer |
Multicast address syntax: group:port:id. The id is used to distinguish two clients at the same host, using the same port. Bind is able to generate a unique id if no id is given.
Connect:
UInt32 intv=1234; MulticastConnection con; con.connect( "224.100.100.100:3333:1" ); con.connect( "224.100.100.100:3333:2" ); con.connect( "224.100.100.100:3333:3" ); con.putValue(intv); con.flush();
Accept:
MulticastConnection con;
con.bind("224.100.100.100:3333:1");
con.accept();
con.selectChannel();
UInt32 x;
con.getValue(x);
|
|
|
|
|
Reimplemented from osg::Connection. |
|
|
|
|
|
Constructor.
|
|
|
Destructor.
|
|
|
prohibit default function (move to 'public' if needed)
|
|
|
Bind connection to the givven address. Describes, on which port the connection will accept incomming connecitons. If the address string contains no id, then a random id will be choosen. If group is empty, then 224.11.12.50 is used.
Implements osg::Connection. |
|
|
Wait for incommint connections on the given address.
Implements osg::Connection. |
|
|
connect a connection at the given address
Implements osg::Connection. |
|
|
wait for sync
Implements osg::Connection. |
|
|
send sync
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
|
|
|
Write buffer. A simple reliable UDP package protocoll is used.
Reimplemented from osg::BinaryDataHandler. |
|
|
Write buffer. A simple reliable UDP package protocoll is used.
Reimplemented from osg::BinaryDataHandler. |
|
||||||||||||||||||||
|
nterprete address multicastgroup:port:client |
|
|
Start alive thread. To enable the receiver to detect a canceled sender, we need an alive signal avery n seconds. Then the receiver is able to set it's timeout to n+1 |
|
|
Stop alive thread.
|
|
|
Start alive thread. Send an alive package after _aliveTime |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Start alive thread. To enable the receiver to detect a canceled sender, we need an alive signal avery n seconds. Then the receiver is able to set it's timeout to n+1 |
|
|
Start alive thread. To enable the receiver to detect a canceled sender, we need an alive signal avery n seconds. Then the receiver is able to set it's timeout to n+1 |
1.2.16