eq::net::UDPConnection Class Reference

A udp connection (Attn: only multicast usage implemented). More...

#include <udpConnection.h>

Inheritance diagram for eq::net::UDPConnection:
Inheritance graph
[legend]
Collaboration diagram for eq::net::UDPConnection:
Collaboration graph
[legend]

List of all members.

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)

Detailed Description

A udp connection (Attn: only multicast usage implemented).

Definition at line 38 of file udpConnection.h.


Constructor & Destructor Documentation

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.

Here is the call graph for this function:


Member Function Documentation

bool eq::net::UDPConnection::connect (  )  [virtual]

Connect to the remote peer.

The ConnectionDescription of this connection is used to identify the peer's parameters.

Returns:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

See also:
Connection::listen

Reimplemented from eq::net::Connection.

Definition at line 58 of file udpConnection.h.

References connect().

Here is the call graph for this function:

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.

See also:
acceptSync()

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.

Returns:
the new connection, 0 on error.

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.

Parameters:
buffer the buffer receiving the data.
bytes the number of bytes to read.
See also:
readSync()

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().

Here is the call graph for this function:

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.

Parameters:
buffer the buffer receiving the data.
bytes the number of bytes to read.
Returns:
the number of bytes read, or -1 upon error.

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().

Here is the call graph for this function:

int64_t eq::net::UDPConnection::write ( const void *  buffer,
const uint64_t  bytes 
) [virtual]

Write data to the connection.

Parameters:
buffer the buffer containing the message.
bytes the number of bytes to write.
Returns:
the number of bytes written, or -1 upon error.

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().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Sat Feb 6 13:11:53 2010 for Equalizer 0.9.1 by  doxygen 1.6.1