A reliable multicast connection. More...
#include <rspConnection.h>
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 |
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.
| 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().
| 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.
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.
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.
| 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().
| virtual Notifier eq::net::RSPConnection::getNotifier | ( | ) | const [inline, virtual] |
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.
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().
| 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.
| buffer | the buffer receiving the data. |
| bytes | the number of bytes to read. |
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.
| buffer | the buffer receiving the data. |
| bytes | the number of bytes to read. |
| block | internal WAR parameter, ignore it in the implementation unless you know exactly why not. |
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.
| int64_t eq::net::RSPConnection::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. |
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.
1.0-alpha by
1.7.2