Classes | Public Member Functions

eq::net::RSPConnection Class Reference

A reliable multicast connection. More...

#include <rspConnection.h>

Inheritance diagram for eq::net::RSPConnection:
Collaboration diagram for eq::net::RSPConnection:

List of all members.

Classes

struct  DatagramAck
 Acknowledge reception of all packets including sequence .
struct  DatagramAckRequest
 Request receive confirmation of all packets up to sequence.
struct  DatagramCount
 Announce number of known connections.
struct  DatagramData
 Data packet.
struct  DatagramNack
 Request resend of lost packets.
struct  DatagramNode
 ID_HELLO, ID_DENY, ID_CONFIRM or ID_EXIT packet.
struct  Nack
 Missing packets from start..end sequence.
class  Thread
 Thread managing network IO and RSP protocol.

Public Member Functions

 RSPConnection ()
 Create a new RSP-based connection.
virtual bool listen ()
 Put the connection into the listening state.
void close ()
 Close a connected or listening connection.
bool connect ()
 Identical to listen() for multicast connections.
virtual void acceptNB ()
 Start an accept operation.
virtual ConnectionPtr acceptSync ()
 Complete an accept operation.
virtual void readNB (void *, const uint64_t)
 Start a read operation on the connection.
virtual int64_t readSync (void *buffer, const uint64_t bytes, const bool ignored)
 Finish reading data from the connection.
virtual int64_t write (const void *buffer, const uint64_t bytes)
 Write data to the connection.
int64_t getSendRate () const
uint16_t getID () const
virtual Notifier getNotifier () const

Detailed Description

A reliable multicast connection.

This connection implements a reliable stream protocol (RSP) over IP V4 UDP multicast. The RSP design document describes the high-level protocol.

Definition at line 49 of file rspConnection.h.


Constructor & Destructor Documentation

eq::net::RSPConnection::RSPConnection (  )

Create a new RSP-based connection.

Definition at line 68 of file rspConnection.cpp.

References eq::net::Connection::_description, eq::net::CONNECTIONTYPE_RSP, EQLOG, and eq::net::Global::getIAttribute().

Here is the call graph for this function:


Member Function Documentation

virtual void eq::net::RSPConnection::acceptNB (  ) [inline, 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 61 of file rspConnection.h.

References eq::net::Connection::_state, and eq::net::Connection::STATE_LISTENING.

ConnectionPtr eq::net::RSPConnection::acceptSync (  ) [virtual]

Complete an accept operation.

Returns:
the new connection, 0 on error.

Reimplemented from eq::net::Connection.

Definition at line 278 of file rspConnection.cpp.

References eq::net::Connection::_state, EQINFO, eq::base::RefPtr< T >::get(), and eq::net::Connection::STATE_LISTENING.

Here is the call graph for this function:

bool eq::net::RSPConnection::connect (  ) [inline, virtual]

Identical to listen() for multicast connections.

Reimplemented from eq::net::Connection.

Definition at line 59 of file rspConnection.h.

References listen().

Here is the call graph for this function:

virtual Notifier eq::net::RSPConnection::getNotifier (  ) const [inline, virtual]
Returns:
the notifier signaling events on the connection.

Implements eq::net::Connection.

Definition at line 79 of file rspConnection.h.

bool eq::net::RSPConnection::listen (  ) [virtual]

Put the connection into the listening state.

The ConnectionDescription of this connection is used to identify the listening parameters.

Returns:
true if the connection is listening for new incoming connections, false if not.

Reimplemented from eq::net::Connection.

Definition at line 189 of file rspConnection.cpp.

References eq::net::Connection::_description, eq::net::Connection::_state, close(), eq::net::CONNECTIONTYPE_RSP, EQINFO, EQWARN, eq::net::Global::getIAttribute(), eq::base::MTQueue< T >::isEmpty(), eq::base::MTQueue< T >::push(), eq::net::Connection::STATE_CLOSED, and eq::net::Connection::STATE_CONNECTING.

Referenced by connect().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void eq::net::RSPConnection::readNB ( void *  buffer,
const   bytes 
) [inline, 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:
bufferthe buffer receiving the data.
bytesthe number of bytes to read.
See also:
readSync()

Implements eq::net::Connection.

Definition at line 64 of file rspConnection.h.

int64_t eq::net::RSPConnection::readSync ( void *  buffer,
const uint64_t  bytes,
const bool  block 
) [virtual]

Finish reading data from the connection.

This method is the low-level counterpart to recvSync(). It may return with a partial read.

Parameters:
bufferthe buffer receiving the data.
bytesthe number of bytes to read.
blockinternal WAR parameter, ignore it in the implementation unless you know exactly why not.
Returns:
the number of bytes read, or -1 upon error.

Implements eq::net::Connection.

Definition at line 305 of file rspConnection.cpp.

References eq::net::Connection::_state, close(), EQ_MIN, eq::base::Buffer< T >::getData(), eq::base::MTQueue< T >::isEmpty(), eq::base::MTQueue< T >::pop(), eq::base::LFQueue< T >::push(), and eq::net::Connection::STATE_CONNECTED.

Here is the call graph for this function:

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

Write data to the connection.

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

Implements eq::net::Connection.

Definition at line 1427 of file rspConnection.cpp.

References eq::net::Connection::_state, close(), EQ_MIN, EQLOG, eq::base::Buffer< T >::getData(), eq::base::MTQueue< T >::isEmpty(), eq::base::RefPtr< T >::isValid(), eq::base::MTQueue< T >::pop(), eq::base::LFQueue< T >::push(), and eq::net::Connection::STATE_LISTENING.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Wed Dec 1 2010 15:34:36 for EqualizerInternal 1.0-alpha by  1.7.2