#include <SocketPair.h>
Public Member Functions | |
SocketPair (NLsocket reliable=NL_INVALID, NLsocket unreliable=NL_INVALID) | |
Initializes this object, with optional initial values for the sockets. The value NL_INVALID should always be used for sockets that are not active. | |
~SocketPair () | |
Since this is just a class to contain the sockets, the sockets are not disconnected on exit. | |
void | disconnect () |
Calls a low-level disconnect (nlClose) on both sockets, if they are not NL_INVALID, and then sets them to NL_INVALID. | |
Address | getLocalAddress (bool reliable) const |
Address | getRemoteAddress (bool reliable) const |
ConnectionStats | getStats (int reliable) const |
int | rawRead (bool reliable, Buffer &buf) const |
Performs a low-level read on a socket. | |
int | rawWrite (bool reliable, const Buffer &buf) const |
Performs a low-level write on a socket. | |
Public Attributes | |
NLsocket | r |
The reliable socket. | |
NLsocket | u |
The unreliable socket. |
|
|
|
|
|
|
|
Performs a low-level read on a socket. First, clear is called on the Buffer. Then the read is performed. The number of bytes read is set to be the new limit, and this number is returned. The position is set to 0. Up get getCapacity bytes will be read. I do know that this is undeseriable functionality but these are the semantics that were used with the old RawPacket, and since SocketPair is an internal GNE class, I kept the semantics. Preferably, the rawRead and rawWrite functions should work based on getRemaining on the Buffer and act as if they are reading or writing bytes from the Buffers, so that their positions change.
|
|
Performs a low-level write on a socket. I do know that this is undeseriable functionality but these are the semantics that were used with the old RawPacket, and since SocketPair is an internal GNE class, I kept the semantics. Preferably, the rawRead and rawWrite functions should work based on getRemaining on the Buffer and act as if they are reading or writing bytes from the Buffers, so that their positions change.
|