|
dodo
0.0.1
A C++ library to create containerized Linux services
|
Interface to and common implementation of concrete sockets (Socket, TLSSocket). More...
#include <basesocket.hpp>


Public Member Functions | |
| BaseSocket () | |
| Default constructor creates an invalid socket. More... | |
| BaseSocket (bool blocking, SocketParams params) | |
| Construct from SocketParams. More... | |
| BaseSocket (int socket) | |
| Construct from a socket descriptor. More... | |
| virtual | ~BaseSocket () |
| Destructs this Socket, but does not call close(). More... | |
| virtual BaseSocket * | accept ()=0 |
| Accepts a connection request and return a pointer to a new Socket for the new connection, the caller will own the new Socket object. More... | |
| common::SystemError | bind (const Address &address) |
| Bind the socket to the Address. More... | |
| virtual void | close () |
| Closes the socket, causing the connection, if it exists, to be terminated. More... | |
| virtual common::SystemError | connect (const Address &address) |
| Connect to the address. More... | |
| virtual std::string | debugDetail () const |
| Return debug object state as a string. More... | |
| Address | getAddress () const |
| Get the local address for this socket. More... | |
| SocketParams::AddressFamily | getAddressFamily () const |
| Get the SocketParams::AddressFamily of the socket. More... | |
| virtual bool | getBlocking () const |
| Rerurn true if the socket is operating in blocking mode. More... | |
| int | getFD () const |
| Return the socket file descriptor. More... | |
| Address | getPeerAddress () const |
| Get the peer (remote) address for this socket. More... | |
| SocketParams::ProtocolNumber | getProtocolNumber () const |
| Get the SocketParams::ProtocolNumber of the socket. More... | |
| virtual socklen_t | getReceiveBufSize () const |
| Get the maximum buffer length for receive. More... | |
| socklen_t | getSendBufSize () const |
| Get the maximum buffer length for send. More... | |
| SocketParams | getSocketParams () const |
| Return the SocketParams. More... | |
| SocketParams::SocketType | getSocketType () const |
| Get the SocketParams::SocketType of the socket. More... | |
| int | getTTL () const |
| Get the Socket TTL (time to live) or the max number of packet hops. More... | |
| bool | isValid () const |
| Return true when the socket descriptor is a valid, hence 'possible' descriptor. More... | |
| common::SystemError | listen (const Address &address, int backlog) |
| Sets up a listening socket on Address. More... | |
| bool | operator< (const BaseSocket &socket) const |
| Add ordering. More... | |
| BaseSocket & | operator= (const BaseSocket &socket) |
| Assign from Socket. More... | |
| BaseSocket & | operator= (int socket) |
| Assign from existing socket descriptor (int). More... | |
| bool | operator== (const BaseSocket &socket) const |
| Add identity. More... | |
| virtual common::SystemError | receive (void *buf, ssize_t request, ssize_t &received)=0 |
| Receive bytes from the socket. More... | |
| common::SystemError | receiveInt16 (int16_t &value) |
| receive an int16_t More... | |
| common::SystemError | receiveInt32 (int32_t &value) |
| receive an int32_t More... | |
| common::SystemError | receiveInt64 (int64_t &value) |
| receive an int64_t More... | |
| common::SystemError | receiveInt8 (int8_t &value) |
| receive an int8_t More... | |
| common::SystemError | receiveLine (std::string &s) |
| receive a stream of characters until a ' ' is read (consumed from the socket read buffer but not added to s). More... | |
| common::SystemError | receiveString (std::string &s) |
| Receive a std::string as sent by sendString( const std::string& ). More... | |
| common::SystemError | receiveUInt16 (uint16_t &value) |
| receive an uint16_t More... | |
| common::SystemError | receiveUInt32 (uint32_t &value) |
| receive an uint32_t More... | |
| common::SystemError | receiveUInt64 (uint64_t &value) |
| receive an uint64_t More... | |
| common::SystemError | receiveUInt8 (uint8_t &value) |
| receive an uint8_t More... | |
| virtual common::SystemError | send (const void *buf, ssize_t len, bool more=false)=0 |
| Send bytes on the socket. More... | |
| common::SystemError | sendInt16 (int16_t value, bool more=false) |
| Send an int16_t. More... | |
| common::SystemError | sendInt32 (int32_t value, bool more=false) |
| Send an int32_t. More... | |
| common::SystemError | sendInt64 (int64_t value, bool more=false) |
| Send an int64_t. More... | |
| common::SystemError | sendInt8 (int8_t value, bool more=false) |
| Send an int8_t. More... | |
| common::SystemError | sendLine (const std::string &s, bool more) |
| Sends the std::string terminated by a ' '. More... | |
| common::SystemError | sendString (const std::string &s, bool more=false) |
| Sends the std::string as understood by receiveString(). More... | |
| common::SystemError | sendUInt16 (uint16_t value, bool more=false) |
| Send an uint16_t. More... | |
| common::SystemError | sendUInt32 (uint32_t value, bool more=false) |
| Send an uint32_t. More... | |
| common::SystemError | sendUInt64 (uint64_t value, bool more=false) |
| Send an sendUInt64. More... | |
| common::SystemError | sendUInt8 (uint8_t value, bool more=false) |
| Send an uint8_t. More... | |
| void | setBlocking (bool blocking) |
| Set the Socket blocking mode. More... | |
| void | setReceiveBufSize (socklen_t size) |
| Set the size of the receive buffer. More... | |
| void | setReceiveTimeout (double sec) |
| Set the receive timeout - a receive will fail if there is no data received before the timeout expires. More... | |
| void | setReUseAddress () |
| Enable the socket to re-use an address when listen/bind is called. More... | |
| void | setReUsePort () |
| Make the socket re-use a port when listen is called. More... | |
| void | setSendBufSize (socklen_t size) |
| Set the size of the send buffer. More... | |
| void | setSendTimeout (double sec) |
| Set the send timeout - a send will fail if there is no data send before the timeout expires. More... | |
| void | setTCPKeepAlive (bool enable) |
| Enable or disable TCP keep-alive on the socket. More... | |
| void | setTCPNoDelay (bool set) |
| Set TCP_NODELAY. More... | |
| void | setTTL (int ttl) |
| Set the Socket TTL (Time to Live). More... | |
Public Member Functions inherited from dodo::common::DebugObject | |
| DebugObject () | |
| Default constructor does nothing. More... | |
| virtual | ~DebugObject () |
| Destructor does nothing. More... | |
| std::string | debugString () const |
| Return the object dump to string. More... | |
Protected Attributes | |
| int | socket_ |
| The socket file decsriptor. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from dodo::common::DebugObject | |
| std::string | debugHeader () const |
| Generates a debug header (address of this object and a demangled class name. More... | |
Interface to and common implementation of concrete sockets (Socket, TLSSocket).
Definition at line 36 of file basesocket.hpp.
| dodo::network::BaseSocket::BaseSocket | ( | ) |
Default constructor creates an invalid socket.
Definition at line 31 of file basesocket.cpp.
References socket_.
| dodo::network::BaseSocket::BaseSocket | ( | int | socket | ) |
Construct from a socket descriptor.
| socket | The socket file descriptor. |
Definition at line 35 of file basesocket.cpp.
References socket_.
|
explicit |
Construct from SocketParams.
| blocking | If true, create the socket in blocking mode. |
| params | The SocketParams to use. |
Definition at line 39 of file basesocket.cpp.
References dodo::network::SocketParams::getAddressFamily(), dodo::network::SocketParams::getProtocol(), dodo::network::SocketParams::getSocketType(), setBlocking(), setTCPNoDelay(), socket_, and throw_SystemExceptionObject.

|
inlinevirtual |
Destructs this Socket, but does not call close().
Definition at line 60 of file basesocket.hpp.
|
pure virtual |
Accepts a connection request and return a pointer to a new Socket for the new connection, the caller will own the new Socket object.
Implemented in dodo::network::Socket, and dodo::network::TLSSocket.
Referenced by dodo::network::TCPListener::run().

| common::SystemError dodo::network::BaseSocket::bind | ( | const Address & | address | ) |
Bind the socket to the Address.
| address | The address to bind to. |
Definition at line 103 of file basesocket.cpp.
References dodo::network::Address::addr_, dodo::network::Address::asString(), dodo::common::SystemError::ecEACCES, dodo::common::SystemError::ecEADDRINUSE, dodo::common::SystemError::ecOK, socket_, and throw_SystemExceptionObject.
Referenced by listen().


|
virtual |
Closes the socket, causing the connection, if it exists, to be terminated.
Definition at line 71 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
Referenced by dodo::network::TCPListener::closeSocket(), and dodo::network::TCPListener::run().

|
virtual |
Connect to the address.
These common::SystemError may be returned:
In case the system returns other system errors on connect, a common::Exception is thrown.
| address | The address to connect to. |
Reimplemented in dodo::network::TLSSocket.
Definition at line 52 of file basesocket.cpp.
References dodo::common::SystemError::ecEACCES, dodo::common::SystemError::ecEADDRINUSE, dodo::common::SystemError::ecEADDRNOTAVAIL, dodo::common::SystemError::ecEALREADY, dodo::common::SystemError::ecECONNREFUSED, dodo::common::SystemError::ecEINPROGRESS, dodo::common::SystemError::ecEISCONN, dodo::common::SystemError::ecENETUNREACH, dodo::common::SystemError::ecETIMEDOUT, dodo::common::SystemError::ecOK, dodo::network::Address::getAddress(), socket_, and throw_SystemExceptionObject.
Referenced by dodo::network::TLSSocket::connect().


|
virtual |
Return debug object state as a string.
Reimplemented from dodo::common::DebugObject.
Definition at line 46 of file basesocket.cpp.
References socket_.
| Address dodo::network::BaseSocket::getAddress | ( | ) | const |
Get the local address for this socket.
Definition at line 236 of file basesocket.cpp.
References socket_.
| SocketParams::AddressFamily dodo::network::BaseSocket::getAddressFamily | ( | ) | const |
Get the SocketParams::AddressFamily of the socket.
Definition at line 244 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
Referenced by getSocketParams(), and getTTL().

|
virtual |
Rerurn true if the socket is operating in blocking mode.
Definition at line 125 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
Referenced by receiveString(), sendString(), and dodo::network::SocketReadBuffer::SocketReadBuffer().

|
inline |
Return the socket file descriptor.
Definition at line 121 of file basesocket.hpp.
References socket_.
Referenced by dodo::network::TCPListener::closeSocket(), dodo::network::TCPListener::pollAdd(), dodo::network::TCPListener::pollDel(), dodo::network::TCPListener::pollMod(), dodo::network::TCPListener::popWork(), dodo::network::TCPListener::pushWork(), dodo::network::TCPConnectionData::readBuffer(), dodo::network::TCPListener::releaseWork(), dodo::network::TCPServer::run(), and dodo::network::TCPListener::run().

| Address dodo::network::BaseSocket::getPeerAddress | ( | ) | const |
Get the peer (remote) address for this socket.
Definition at line 273 of file basesocket.cpp.
References socket_.
Referenced by dodo::network::TCPServer::run(), and dodo::network::TCPListener::run().

| SocketParams::ProtocolNumber dodo::network::BaseSocket::getProtocolNumber | ( | ) | const |
Get the SocketParams::ProtocolNumber of the socket.
Definition at line 260 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
Referenced by getSocketParams().

|
virtual |
Get the maximum buffer length for receive.
Definition at line 177 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
Referenced by receiveString().

| socklen_t dodo::network::BaseSocket::getSendBufSize | ( | ) | const |
Get the maximum buffer length for send.
Definition at line 169 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
| SocketParams dodo::network::BaseSocket::getSocketParams | ( | ) | const |
Return the SocketParams.
Definition at line 268 of file basesocket.cpp.
References getAddressFamily(), getProtocolNumber(), and getSocketType().

| SocketParams::SocketType dodo::network::BaseSocket::getSocketType | ( | ) | const |
Get the SocketParams::SocketType of the socket.
Definition at line 252 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
Referenced by getSocketParams().

| int dodo::network::BaseSocket::getTTL | ( | ) | const |
Get the Socket TTL (time to live) or the max number of packet hops.
Definition at line 185 of file basesocket.cpp.
References getAddressFamily(), socket_, and throw_SystemExceptionObject.

|
inline |
Return true when the socket descriptor is a valid, hence 'possible' descriptor.
A valid decsriptor does not have to be open/connected or even correct - a valid decsriptor is not -1.
Definition at line 128 of file basesocket.hpp.
References socket_.
Referenced by dodo::network::TCPListener::run(), setBlocking(), and setReUseAddress().

| common::SystemError dodo::network::BaseSocket::listen | ( | const Address & | address, |
| int | backlog | ||
| ) |
Sets up a listening socket on Address.
| address | The Address (including a port) to listen on. |
| backlog | The size of the queue used to cache pending connections. |
or one of the common::SystemError returned by bind( const Address &address ).
Definition at line 89 of file basesocket.cpp.
References dodo::network::Address::asString(), bind(), dodo::common::SystemError::ecEADDRINUSE, dodo::common::SystemError::ecOK, socket_, and throw_SystemExceptionObject.
Referenced by dodo::network::TCPListener::construct().


|
inline |
Add ordering.
| socket | The socket to compare to. |
Definition at line 281 of file basesocket.hpp.
References socket_.
| BaseSocket & dodo::network::BaseSocket::operator= | ( | const BaseSocket & | socket | ) |
| BaseSocket & dodo::network::BaseSocket::operator= | ( | int | socket | ) |
Assign from existing socket descriptor (int).
| socket | The socket value to assign to this Socket. |
Definition at line 79 of file basesocket.cpp.
References socket_.
|
inline |
Add identity.
| socket | The socket to compare to. |
Definition at line 274 of file basesocket.hpp.
References socket_.
|
pure virtual |
Receive bytes from the socket.
| buf | Put bytes received here |
| request | The maximum number of bytes to receive |
| received | The number of bytes received |
Implemented in dodo::network::Socket, and dodo::network::TLSSocket.
Referenced by dodo::network::TCPConnectionData::readBuffer(), receiveInt16(), receiveInt32(), receiveInt64(), receiveInt8(), receiveLine(), receiveString(), receiveUInt16(), receiveUInt32(), receiveUInt64(), receiveUInt8(), and dodo::network::SocketReadBuffer::underflow().

| common::SystemError dodo::network::BaseSocket::receiveInt16 | ( | int16_t & | value | ) |
receive an int16_t
| value | The value received. |
Definition at line 349 of file basesocket.cpp.
References dodo::common::SystemError::ecOK, and receive().

| common::SystemError dodo::network::BaseSocket::receiveInt32 | ( | int32_t & | value | ) |
receive an int32_t
| value | The value received. |
Definition at line 391 of file basesocket.cpp.
References dodo::common::SystemError::ecOK, and receive().

| common::SystemError dodo::network::BaseSocket::receiveInt64 | ( | int64_t & | value | ) |
receive an int64_t
| value | The value received. |
Definition at line 433 of file basesocket.cpp.
References dodo::common::SystemError::ecOK, and receive().

| common::SystemError dodo::network::BaseSocket::receiveInt8 | ( | int8_t & | value | ) |
receive an int8_t
| value | The value received. |
Definition at line 328 of file basesocket.cpp.
References dodo::common::SystemError::ecOK, and receive().

| common::SystemError dodo::network::BaseSocket::receiveLine | ( | std::string & | s | ) |
receive a stream of characters until a '
' is read (consumed from the socket read buffer but not added to s).
| s | receives the read string. |
Definition at line 488 of file basesocket.cpp.
References dodo::common::SystemError::ecOK, and receive().

| common::SystemError dodo::network::BaseSocket::receiveString | ( | std::string & | s | ) |
Receive a std::string as sent by sendString( const std::string& ).
| s | The string to receive into. |
Definition at line 459 of file basesocket.cpp.
References dodo::common::SystemError::ecOK, getBlocking(), getReceiveBufSize(), receive(), receiveUInt64(), and throw_ExceptionObject.

| common::SystemError dodo::network::BaseSocket::receiveUInt16 | ( | uint16_t & | value | ) |
receive an uint16_t
| value | The value received. |
Definition at line 307 of file basesocket.cpp.
References dodo::common::SystemError::ecOK, and receive().

| common::SystemError dodo::network::BaseSocket::receiveUInt32 | ( | uint32_t & | value | ) |
receive an uint32_t
| value | The value received. |
Definition at line 370 of file basesocket.cpp.
References dodo::common::SystemError::ecOK, and receive().

| common::SystemError dodo::network::BaseSocket::receiveUInt64 | ( | uint64_t & | value | ) |
receive an uint64_t
| value | The value received. |
Definition at line 412 of file basesocket.cpp.
References dodo::common::SystemError::ecOK, and receive().
Referenced by receiveString().


| common::SystemError dodo::network::BaseSocket::receiveUInt8 | ( | uint8_t & | value | ) |
receive an uint8_t
| value | The value received. |
Definition at line 286 of file basesocket.cpp.
References dodo::common::SystemError::ecOK, and receive().

|
pure virtual |
Send bytes on the socket.
| buf | Take bytes from here |
| len | The number of bytes. |
| more | Set to true if more is to come (increases packet filling efficiency when accurate). |
Implemented in dodo::network::Socket, and dodo::network::TLSSocket.
Referenced by dodo::network::protocol::http::HTTPRequest::send(), dodo::network::protocol::http::HTTPResponse::send(), sendInt16(), sendInt32(), sendInt64(), sendInt8(), sendLine(), sendString(), sendUInt16(), sendUInt32(), sendUInt64(), sendUInt8(), and dodo::network::protocol::http::HTTPRequest::write().

| common::SystemError dodo::network::BaseSocket::sendInt16 | ( | int16_t | value, |
| bool | more = false |
||
| ) |
Send an int16_t.
| value | The value to send. |
| more | If true, the caller indicates that more data will follow. |
Definition at line 344 of file basesocket.cpp.
References send().

| common::SystemError dodo::network::BaseSocket::sendInt32 | ( | int32_t | value, |
| bool | more = false |
||
| ) |
Send an int32_t.
| value | The value to send. |
| more | If true, the caller indicates that more data will follow. |
Definition at line 386 of file basesocket.cpp.
References send().

| common::SystemError dodo::network::BaseSocket::sendInt64 | ( | int64_t | value, |
| bool | more = false |
||
| ) |
Send an int64_t.
| value | The value to send. |
| more | If true, the caller indicates that more data will follow. |
Definition at line 428 of file basesocket.cpp.
References send().

| common::SystemError dodo::network::BaseSocket::sendInt8 | ( | int8_t | value, |
| bool | more = false |
||
| ) |
Send an int8_t.
| value | The value to send. |
| more | If true, the caller indicates that more data will follow. |
Definition at line 323 of file basesocket.cpp.
References send().

| common::SystemError dodo::network::BaseSocket::sendLine | ( | const std::string & | s, |
| bool | more | ||
| ) |
Sends the std::string terminated by a '
'.
| s | The string to send. |
| more | If true, the caller indicates that more data will follow. |
Definition at line 480 of file basesocket.cpp.
References send().

| common::SystemError dodo::network::BaseSocket::sendString | ( | const std::string & | s, |
| bool | more = false |
||
| ) |
Sends the std::string as understood by receiveString().
The send prefixes the string length in an uint64_t, the number of bytes (characters) that follow.
| s | The string to send. |
| more | If true, the caller indicates that more data will follow. |
Definition at line 449 of file basesocket.cpp.
References dodo::common::SystemError::ecOK, getBlocking(), send(), sendUInt64(), and throw_Exception.

| common::SystemError dodo::network::BaseSocket::sendUInt16 | ( | uint16_t | value, |
| bool | more = false |
||
| ) |
Send an uint16_t.
| value | The value to send. |
| more | If true, the caller indicates that more data will follow. |
Definition at line 302 of file basesocket.cpp.
References send().

| common::SystemError dodo::network::BaseSocket::sendUInt32 | ( | uint32_t | value, |
| bool | more = false |
||
| ) |
Send an uint32_t.
| value | The value to send. |
| more | If true, the caller indicates that more data will follow. |
Definition at line 365 of file basesocket.cpp.
References send().

| common::SystemError dodo::network::BaseSocket::sendUInt64 | ( | uint64_t | value, |
| bool | more = false |
||
| ) |
Send an sendUInt64.
| value | The value to send. |
| more | If true, the caller indicates that more data will follow. |
Definition at line 407 of file basesocket.cpp.
References send().
Referenced by sendString().


| common::SystemError dodo::network::BaseSocket::sendUInt8 | ( | uint8_t | value, |
| bool | more = false |
||
| ) |
Send an uint8_t.
| value | The value to send. |
| more | If true, the caller indicates that more data will follow. |
Definition at line 281 of file basesocket.cpp.
References send().

| void dodo::network::BaseSocket::setBlocking | ( | bool | blocking | ) |
Set the Socket blocking mode.
| blocking | Blocking if true. |
Definition at line 131 of file basesocket.cpp.
References isValid(), socket_, throw_Exception, and throw_SystemExceptionObject.
Referenced by BaseSocket(), dodo::network::TCPListener::construct(), and dodo::network::TCPListener::run().


| void dodo::network::BaseSocket::setReceiveBufSize | ( | socklen_t | size | ) |
Set the size of the receive buffer.
Linux will (at least) double the memory for socket accounting purposes. If size < system minimum size, the system will set the latter.
| size | The size to set the receive buffer to. |
Definition at line 204 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
Referenced by dodo::network::TCPListener::construct().

| void dodo::network::BaseSocket::setReceiveTimeout | ( | double | sec | ) |
Set the receive timeout - a receive will fail if there is no data received before the timeout expires.
Note that the default is 0 seconds, meaning no timeout / wait forever.
| sec | Timeout value, in seconds, fractions allowed. |
Definition at line 209 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
Referenced by dodo::network::TCPListener::construct(), and dodo::network::TCPListener::run().

| void dodo::network::BaseSocket::setReUseAddress | ( | ) |
Enable the socket to re-use an address when listen/bind is called.
In transit TCP messages sent to a server previously listening on this address will not be picked up by the re-used address.
Definition at line 148 of file basesocket.cpp.
References isValid(), socket_, throw_Exception, and throw_SystemExceptionObject.
Referenced by dodo::network::TCPListener::construct().


| void dodo::network::BaseSocket::setReUsePort | ( | ) |
Make the socket re-use a port when listen is called.
Definition at line 159 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
Referenced by dodo::network::TCPListener::construct().

| void dodo::network::BaseSocket::setSendBufSize | ( | socklen_t | size | ) |
Set the size of the send buffer.
Linux will (at least) double the memory for socket accounting purposes. If size < system minimum size or size > system maximum size, the system will silently overrule. Also note that getSendBufSize() and getReceiveBufSize() return the size of the kernel send buffer divided by two, as the Linux man 7 socket states: "...Linux assumes that half of the send/receive buffer is used for internal kernel structures;" So getSendBufSize() and getReceiveBufSize() return the values from a programmer perspective - it is the number of bytes the programmer can actually send or receive in one go
| size | The size to set the send buffer to. |
Definition at line 199 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
Referenced by dodo::network::TCPListener::construct().

| void dodo::network::BaseSocket::setSendTimeout | ( | double | sec | ) |
Set the send timeout - a send will fail if there is no data send before the timeout expires.
Note that the default is 0 seconds, meaning no timeout / wait forever.
| sec | Timeout value, in seconds, fractions allowed. |
Definition at line 219 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
Referenced by dodo::network::TCPListener::construct(), and dodo::network::TCPListener::run().

| void dodo::network::BaseSocket::setTCPKeepAlive | ( | bool | enable | ) |
Enable or disable TCP keep-alive on the socket.
This might be useful to keep connections ope that run through a firewall that disconnects connections that are idle. Note that keep-alive itself is configured through the Linux kernel. Note that enabling keep-alive will not change the behavior of the socket from a developers perspective but ti does incur a bit of network overhead.
| enable | If true enable, otherwise disable. |
Definition at line 120 of file basesocket.cpp.
References socket_.
Referenced by dodo::network::TCPListener::run().

| void dodo::network::BaseSocket::setTCPNoDelay | ( | bool | set | ) |
Set TCP_NODELAY.
If true, disable Nagle's algorithm.
| set | If true, set TCP_NODELAY. |
Definition at line 115 of file basesocket.cpp.
References socket_.
Referenced by BaseSocket(), and dodo::network::TCPListener::run().

| void dodo::network::BaseSocket::setTTL | ( | int | ttl | ) |
Set the Socket TTL (Time to Live).
| ttl | The ttl value to set. |
Definition at line 229 of file basesocket.cpp.
References socket_, and throw_SystemExceptionObject.
|
protected |
The socket file decsriptor.
Definition at line 503 of file basesocket.hpp.
Referenced by dodo::network::Socket::accept(), BaseSocket(), bind(), close(), connect(), dodo::network::TLSSocket::connect(), debugDetail(), getAddress(), getAddressFamily(), getBlocking(), getFD(), getPeerAddress(), getProtocolNumber(), getReceiveBufSize(), getSendBufSize(), getSocketType(), getTTL(), isValid(), listen(), dodo::network::TLSSocket::operator<(), operator<(), operator=(), dodo::network::TLSSocket::operator==(), operator==(), dodo::network::Socket::receive(), dodo::network::Socket::send(), dodo::network::Socket::sendTo(), setBlocking(), setReceiveBufSize(), setReceiveTimeout(), setReUseAddress(), setReUsePort(), setSendBufSize(), setSendTimeout(), setTCPKeepAlive(), setTCPNoDelay(), setTTL(), and dodo::network::TLSSocket::TLSSocket().