#include <mcllib/MCSocket.h>
Inheritance diagram for MCStreamSocket:
Public Member Functions | |
virtual void | accept (MCStreamSocket *pSock, mcinterval_t timeout=MCIntervalInfinite) |
Accept an incoming connection. | |
bool | getKeepAlive () const |
Determine whether keepalives are active. | |
bool | getLinger () const |
Determine whether linger is enabled on the socket. | |
mcinterval_t | getLingerTime () const |
Determine the linger time of the socket. | |
mcuint32 | getMss () const |
Get the maximum segment size for the socket. | |
bool | getNoDelay () const |
Determine if no delay is enabled. | |
void | listen (mcintn queueLength) |
Put the socket into the listening state ready for accept()ing connections. | |
void | setKeepAlive (bool keepAlive) |
Control whether keepalives are active. | |
void | setLinger (bool linger, mcinterval_t timeout) |
Control whether linger is enabled on the socket. | |
void | setMss (mcuint32 mss) |
Set the maximum segment size for the socket. | |
void | setNoDelay (bool noDelay) |
Control delay behaviour of the socket. | |
void | shutdownRecv () |
Shutdown receive side of the socket. | |
void | shutdownSend () |
Shutdown send side of the socket. | |
virtual | ~MCStreamSocket () |
virtual destructor | |
Protected Member Functions | |
MCStreamSocket (void *impl) | |
Construct from an implementation. | |
MCStreamSocket () | |
Default constructor for use by derived classes. |
|
Construct from an implementation. The implementation object must be derived from MCStreamSockBaseImpl |
|
Accept an incoming connection. Accept the first connection request on the queue of a listening socket. The listen() method must be called first with the length of the queue to put the bound socket into a listening state. If the accept fails for any reason an exception is thrown.
|
|
Determine whether keepalives are active.
|
|
Determine whether linger is enabled on the socket.
|
|
Determine the linger time of the socket.
|
|
Get the maximum segment size for the socket.
|
|
Determine if no delay is enabled.
|
|
Put the socket into the listening state ready for accept()ing connections.
|
|
Control whether keepalives are active. If keep-alives are enabled, special keep-alive messages are sent periodically to ensure the connection remains active and is not shutdown by the remote end. The frequency with which keep-alive messages are sent and the delay before the first keep-alive is sent are controlled by the operating system and cannot be set by the library.
|
|
Control whether linger is enabled on the socket. If linger is enabled a close() or shutdown() will not return until all queued messages for the socket have been successfully sent or the linger timeout (in milliseconds) has been reached. If linger is disabled a close() or shutdown() returns immediately and any queued messages are sent in the background.
|
|
Set the maximum segment size for the socket.
|
|
Control delay behaviour of the socket. If no delay is enabled any data sent to the socket will be transmitted immediately. If no delay is disabled data sent to the socket will be transparently queued so that fewer transmissions are made to the remote socket. This can severly impact performance in request/response protocols with small messages requiring minimum latency. However, queueing data will result in higher throughput (better bandwidth utilization).
|