A udp connection (Attn: only multicast usage implemented). More...
#include <udpConnection.h>


Public Member Functions | |
| UDPConnection () | |
| Create a new udp-based connection. | |
| virtual bool | connect () |
| Connect to the remote peer. | |
| virtual bool | listen () |
| Listening on a UDP connection is the same as connecting. | |
| virtual void | acceptNB () |
| Start an accept operation. | |
| virtual ConnectionPtr | acceptSync () |
| Complete an accept operation. | |
| virtual void | close () |
| Close a connected or listening connection. | |
| virtual void | readNB (void *buffer, const uint64_t bytes) |
| Start a read operation on the connection. | |
| virtual int64_t | readSync (void *buffer, const uint64_t bytes) |
| Finish reading data from the connection. | |
| virtual int64_t | write (const void *buffer, const uint64_t bytes) |
| Write data to the connection. | |
| int32_t | getMTU () |
| int32_t | getPacketRate () |
| void | waitWritable (const uint64_t bytes) |
| void | adaptSendRate (int32_t percent) |
| int64_t | getSendRate () const |
| bool | setMulticastLoop (bool activate) |
A udp connection (Attn: only multicast usage implemented).
Definition at line 38 of file udpConnection.h.
| eq::net::UDPConnection::UDPConnection | ( | ) |
Create a new udp-based connection.
Definition at line 55 of file udpConnection.cpp.
References eq::net::Connection::_description, eq::net::CONNECTIONTYPE_UDP, EQVERB, eq::net::Global::getIAttribute(), eq::net::Global::IATTR_UDP_MTU, and eq::net::Global::IATTR_UDP_PACKET_RATE.

| bool eq::net::UDPConnection::connect | ( | ) | [virtual] |
Connect to the remote peer.
The ConnectionDescription of this connection is used to identify the peer's parameters.
true if the connection was successfully connected, false if not. Reimplemented from eq::net::Connection.
Definition at line 88 of file udpConnection.cpp.
References eq::net::Connection::_description, eq::net::FDConnection::_readFD, eq::net::Connection::_state, eq::net::FDConnection::_writeFD, close(), eq::net::CONNECTIONTYPE_UDP, EQINFO, EQWARN, eq::net::Connection::STATE_CLOSED, eq::net::Connection::STATE_CONNECTED, eq::net::Connection::STATE_CONNECTING, and eq::base::sysError().
Referenced by listen().


| virtual bool eq::net::UDPConnection::listen | ( | ) | [inline, virtual] |
Listening on a UDP connection is the same as connecting.
Consequently, listen will put this connection into the connected state.
Reimplemented from eq::net::Connection.
Definition at line 58 of file udpConnection.h.
References connect().

| void eq::net::UDPConnection::acceptNB | ( | ) | [virtual] |
Start an accept operation.
This method returns immediately. The Notifier will signal a new connection request, upon which acceptSync() should be used to finish the accept operation.
Reimplemented from eq::net::Connection.
Definition at line 309 of file udpConnection.cpp.
References eq::net::Connection::_state, and eq::net::Connection::STATE_LISTENING.
| ConnectionPtr eq::net::UDPConnection::acceptSync | ( | ) | [virtual] |
Complete an accept operation.
Reimplemented from eq::net::Connection.
Definition at line 315 of file udpConnection.cpp.
References eq::net::Connection::_state, and eq::net::Connection::STATE_LISTENING.
| void eq::net::UDPConnection::readNB | ( | void * | buffer, | |
| const uint64_t | bytes | |||
| ) | [virtual] |
Start a read operation on the connection.
This method is the low-level counterpart to recvNB().
This function returns immediately. The operation's Notifier will signal data availability, upon which readSync() should be used to finish the operation.
| buffer | the buffer receiving the data. | |
| bytes | the number of bytes to read. |
Reimplemented from eq::net::FDConnection.
Definition at line 326 of file udpConnection.cpp.
References eq::net::FDConnection::_readFD, eq::net::Connection::_state, close(), EQ_MIN, EQWARN, eq::net::Connection::STATE_CLOSED, and eq::base::sysError().

| int64_t eq::net::UDPConnection::readSync | ( | void * | buffer, | |
| const uint64_t | bytes | |||
| ) | [virtual] |
Finish reading data from the connection.
This method is the low-level counterpart to recvSync(). It may return with a partial read.
| buffer | the buffer receiving the data. | |
| bytes | the number of bytes to read. |
Reimplemented from eq::net::FDConnection.
Definition at line 356 of file udpConnection.cpp.
References eq::net::FDConnection::_readFD, close(), EQ_MIN, EQERROR, EQINFO, EQVERB, EQWARN, and eq::base::sysError().

| int64_t eq::net::UDPConnection::write | ( | const void * | buffer, | |
| const uint64_t | bytes | |||
| ) | [virtual] |
Write data to the connection.
| buffer | the buffer containing the message. | |
| bytes | the number of bytes to write. |
Reimplemented from eq::net::FDConnection.
Definition at line 447 of file udpConnection.cpp.
References eq::net::Connection::_state, eq::net::FDConnection::_writeFD, EQWARN, eq::net::Connection::send(), eq::net::Connection::STATE_CONNECTED, and eq::base::sysError().

0.9.1 by
1.6.1