Home
Net module

TCPSocket

TCP socket implementation.

TCPSocket

#include <icy/net/tcpsocket.h>
class TCPSocket

Defined in src/net/include/icy/net/tcpsocket.h:30

Inherits: Stream< uv_tcp_t >, Socket Subclassed by: SSLSocket

TCP socket implementation.

List of all members

NameKindOwner
AcceptConnectionvariableDeclared here
TCPSocketfunctionDeclared here
~TCPSocketfunctionDeclared here
TCPSocketfunctionDeclared here
operator=functionDeclared here
TCPSocketfunctionDeclared here
operator=functionDeclared here
shutdownfunctionDeclared here
closefunctionDeclared here
connectfunctionDeclared here
connectfunctionDeclared here
sendfunctionDeclared here
sendOwnedfunctionDeclared here
sendfunctionDeclared here
sendOwnedfunctionDeclared here
bindfunctionDeclared here
listenfunctionDeclared here
acceptConnectionfunctionDeclared here
setReusePortfunctionDeclared here
setNoDelayfunctionDeclared here
setKeepAlivefunctionDeclared here
setSimultaneousAcceptsfunctionDeclared here
setModefunctionDeclared here
modefunctionDeclared here
setErrorfunctionDeclared here
errorfunctionDeclared here
closedfunctionDeclared here
addressfunctionDeclared here
peerAddressfunctionDeclared here
transportfunctionDeclared here
loopfunctionDeclared here
onConnectfunctionDeclared here
onReadfunctionDeclared here
onRecvfunctionDeclared here
onErrorfunctionDeclared here
onClosefunctionDeclared here
_modevariableDeclared here
_peerAddressvariableDeclared here
initfunctionDeclared here
resetfunctionDeclared here
PtrtypedefDeclared here
VectypedefDeclared here
ReadvariableInherited from Stream
StreamfunctionInherited from Stream
~StreamfunctionInherited from Stream
closefunctionInherited from Stream
shutdownfunctionInherited from Stream
writefunctionInherited from Stream
writeOwnedfunctionInherited from Stream
setHighWaterMarkfunctionInherited from Stream
writefunctionInherited from Stream
streamfunctionInherited from Stream
_buffervariableInherited from Stream
_startedvariableInherited from Stream
_highWaterMarkvariableInherited from Stream
_writeReqFreevariableInherited from Stream
_ownedWriteReqFreevariableInherited from Stream
readStartfunctionInherited from Stream
readStopfunctionInherited from Stream
onReadfunctionInherited from Stream
allocWriteReqfunctionInherited from Stream
freeWriteReqfunctionInherited from Stream
allocOwnedWriteReqfunctionInherited from Stream
freeOwnedWriteReqfunctionInherited from Stream
canQueueWritefunctionInherited from Stream
HandletypedefInherited from Stream
HandlefunctionInherited from Handle
~HandlefunctionInherited from Handle
initfunctionInherited from Handle
invokefunctionInherited from Handle
invokeOrThrowfunctionInherited from Handle
closefunctionInherited from Handle
reffunctionInherited from Handle
unreffunctionInherited from Handle
initializedfunctionInherited from Handle
activefunctionInherited from Handle
closingfunctionInherited from Handle
closedfunctionInherited from Handle
errorfunctionInherited from Handle
setErrorfunctionInherited from Handle
setUVErrorfunctionInherited from Handle
setAndThrowErrorfunctionInherited from Handle
throwLastErrorfunctionInherited from Handle
loopfunctionInherited from Handle
resetfunctionInherited from Handle
getfunctionInherited from Handle
tidfunctionInherited from Handle
contextfunctionInherited from Handle
setCloseCleanupfunctionInherited from Handle
clearCloseCleanupfunctionInherited from Handle
assertThreadfunctionInherited from Handle
_loopvariableInherited from Handle
_contextvariableInherited from Handle
_tidvariableInherited from Handle
_errorvariableInherited from Handle
onErrorfunctionInherited from Handle
onClosefunctionInherited from Handle
HandlefunctionInherited from Handle
operator=functionInherited from Handle
HandlefunctionInherited from Handle
operator=functionInherited from Handle
TypetypedefInherited from Handle
opaquevariableInherited from Socket
SocketfunctionInherited from Socket
~SocketfunctionInherited from Socket
SocketfunctionInherited from Socket
operator=functionInherited from Socket
SocketfunctionInherited from Socket
operator=functionInherited from Socket
connectfunctionInherited from Socket
connectfunctionInherited from Socket
bindfunctionInherited from Socket
listenfunctionInherited from Socket
shutdownfunctionInherited from Socket
sendOwnedfunctionInherited from Socket
sendOwnedfunctionInherited from Socket
closefunctionInherited from Socket
addressfunctionInherited from Socket
peerAddressfunctionInherited from Socket
transportfunctionInherited from Socket
setErrorfunctionInherited from Socket
errorfunctionInherited from Socket
closedfunctionInherited from Socket
loopfunctionInherited from Socket
_afvariableInherited from Socket
initfunctionInherited from Socket
resetfunctionInherited from Socket
PtrtypedefInherited from Socket
VectypedefInherited from Socket
priorityvariableInherited from SocketAdapter
SocketAdapterfunctionInherited from SocketAdapter
~SocketAdapterfunctionInherited from SocketAdapter
sendfunctionInherited from SocketAdapter
sendfunctionInherited from SocketAdapter
sendOwnedfunctionInherited from SocketAdapter
sendOwnedfunctionInherited from SocketAdapter
sendPacketfunctionInherited from SocketAdapter
sendPacketfunctionInherited from SocketAdapter
sendPacketfunctionInherited from SocketAdapter
setSenderfunctionInherited from SocketAdapter
senderfunctionInherited from SocketAdapter
addReceiverfunctionInherited from SocketAdapter
removeReceiverfunctionInherited from SocketAdapter
hasReceiverfunctionInherited from SocketAdapter
receiversfunctionInherited from SocketAdapter
onSocketConnectfunctionInherited from SocketAdapter
onSocketRecvfunctionInherited from SocketAdapter
onSocketErrorfunctionInherited from SocketAdapter
onSocketClosefunctionInherited from SocketAdapter
_sendervariableInherited from SocketAdapter
_receiversvariableInherited from SocketAdapter
_dirtyvariableInherited from SocketAdapter
cleanupReceiversfunctionInherited from SocketAdapter

Inherited from Stream

KindNameDescription
variableReadEmitted when data has been received from the peer.
functionStream inlineConstruct the stream bound to loop with a 64 KiB read buffer.
function~Stream virtual inlineDestroy the stream, stopping reads and freeing pooled write requests.
functionclose virtual inline overrideCloses and resets the stream handle. This will close the active socket/pipe and destroy the handle.
functionshutdown inlineSend a TCP/pipe shutdown request to the connected peer.
functionwrite inlineWrite len bytes from data to the stream.
functionwriteOwned inlineWrite an owned payload buffer to the stream.
functionsetHighWaterMark inlineSet the high water mark for the write queue (default 16MB). When the write queue exceeds this size, write() returns false.
functionwrite inlineWrite len bytes from data together with a stream handle over an IPC pipe (uses uv_write2).
functionstream inlineReturn the underlying uv_stream_t pointer cast from the native handle.
variable_buffer
variable_started
variable_highWaterMark16MB default write queue limit
variable_writeReqFreeFreelist for write requests.
variable_ownedWriteReqFreeFreelist for owned write requests.
functionreadStart virtual inlineBegin reading from the stream by registering libuv read callbacks.
functionreadStop virtual inlineStop reading from the stream.
functiononRead virtual inlineCalled by handleRead when len bytes of data arrive.
functionallocWriteReq inlineReturn a uv_write_t from the freelist, or allocate a new one if the pool is empty.
functionfreeWriteReq inlineReturn req to the freelist, or delete it if the pool is at capacity.
functionallocOwnedWriteReq inline
functionfreeOwnedWriteReq inline
functioncanQueueWrite inline
typedefHandle

Inherited from Handle

KindNameDescription
functionHandle inlineConstruct the handle bound to the given event loop.
function~Handle virtual inline
functioninit inlineInitialize the underlying libuv handle by calling f with the loop, the raw handle pointer, and any additional args.
functioninvoke inlineInvoke a libuv function f with args on the initialized handle.
functioninvokeOrThrow inlineInvoke a libuv function f with args, throwing on failure.
functionclose virtual inlineClose and destroy the handle.
functionref inlineRe-reference the handle with the event loop after a previous [unref()](icy-uv-Handle.html#unref).
functionunref inlineUnreference the handle from the event loop.
functioninitialized const inlineReturn true if the handle has been successfully initialized via [init()](icy-uv-Handle.html#init-8).
functionactive virtual const inlineReturn true when the handle is active (libuv uv_is_active).
functionclosing virtual const inlineReturn true if uv_close has been called and the handle is awaiting its close callback (libuv uv_is_closing).
functionclosed virtual const inlineReturn true if the handle has been fully closed (context released).
functionerror const inlineReturn the last error set on this handle, or a default-constructed [Error](icy-Error.html#error) if no error has occurred.
functionsetError virtual inlineSet the error state and invoke [onError()](icy-uv-Handle.html#onerror).
functionsetUVError inlineTranslate a libuv error code into an [Error](icy-Error.html#error) and call [setError()](icy-uv-Handle.html#seterror-1).
functionsetAndThrowError inlineSet the error state from a libuv error code and throw a std::runtime_error.
functionthrowLastError inlineThrow a std::runtime_error if the handle currently holds an error.
functionloop const inlineReturn the event loop this handle is bound to.
functionreset inlineClose the current handle (if open) and allocate a fresh [Context](icy-uv-Context.html#context-2), leaving the handle ready to be re-initialized via [init()](icy-uv-Handle.html#init-8).
functionget const inlineReturn the raw libuv handle pointer cast to [Handle](icy-uv-Handle.html#handle-6).
functiontid const inlineReturn the ID of the thread that constructed this handle.
functioncontext const inlineReturn the raw [Context](icy-uv-Context.html#context-2) that owns the libuv handle memory.
functionsetCloseCleanup inline
functionclearCloseCleanup inline
functionassertThread const inlineThrow std::logic_error if called from any thread other than the thread that constructed this handle.
variable_loop
variable_context
variable_tid
variable_error
functiononError virtual inlineCalled by [setError()](icy-uv-Handle.html#seterror-1) after the error state has been updated.
functiononClose virtual inlineCalled by [close()](icy-uv-Handle.html#close-18) after the context has been released.
functionHandleNonCopyable and NonMovable.
functionoperator=Deleted assignment operator.
functionHandleDeleted constructor.
functionoperator=Deleted assignment operator.
typedefTypeDefine the native handle type.

Inherited from Socket

KindNameDescription
variableopaqueOptional client data.
functionSocketDefaulted constructor.
function~Socket virtual noexceptDefaulted destructor.
functionSocketDeleted constructor.
functionoperator=Deleted assignment operator.
functionSocketDeleted constructor.
functionoperator=Deleted assignment operator.
functionconnect virtualConnects to the given peer IP address.
functionconnect virtualResolves and connects to the given host address.
functionbind virtualBind a local address to the socket. The address may be IPv4 or IPv6 (if supported).
functionlisten virtual inlineListens the socket on the given address.
functionshutdown virtual inlineSends the shutdown packet which should result is socket closure via callback.
functionsendOwned virtualSends an owned payload buffer to the connected peer.
functionsendOwned virtual
functionclose virtualCloses the underlying socket.
functionaddress virtual constThe locally bound address.
functionpeerAddress virtual constThe connected peer address.
functiontransport virtual constThe transport protocol: TCP, UDP or SSLTCP.
functionsetError virtualSets the socket error.
functionerror virtual constReturn the socket error if any.
functionclosed virtual constReturns true if the native socket handle is closed.
functionloop virtual constReturns the socket event loop.
variable_af
functioninit virtualInitializes the underlying socket context.
functionreset virtualResets the socket context for reuse.
typedefPtr
typedefVec

Inherited from SocketAdapter

KindNameDescription
variablepriorityThe priority of this adapter for STL sort operations.
functionSocketAdapterCreates the SocketAdapter.
function~SocketAdapter virtual noexceptDestroys the SocketAdapter.
functionsend virtualSends the given data buffer to the connected peer. Returns the number of bytes sent or -1 on error. No exception will be thrown. For TCP sockets the given peer address must match the connected peer address.
functionsend virtual
functionsendOwned virtualSends an owned payload buffer to the connected peer.
functionsendOwned virtual
functionsendPacket virtualSends the given packet to the connected peer. Returns the number of bytes sent or -1 on error. No exception will be thrown. For TCP sockets the given peer address must match the connected peer address.
functionsendPacket virtual
functionsendPacket virtualSends the given packet to the connected peer. This method provides delegate compatibility, and unlike other send methods throws an exception if the underlying socket is closed.
functionsetSender virtualSets the pointer to the outgoing data adapter. Send methods proxy data to this adapter by default.
functionsenderReturns the output SocketAdapter pointer.
functionaddReceiver virtualSets the pointer to the incoming data adapter. Events proxy data to this adapter by default.
functionremoveReceiver virtualRemove the given receiver.
functionhasReceiver virtualReturns true if the given receiver is connected.
functionreceiversReturns all currently registered input SocketAdapter pointers. Dead (removed) entries are excluded from the returned list.
functiononSocketConnect virtualCalled when the socket establishes a connection. Forwards the event to all registered receivers in priority order. Override to intercept before the application sees the event.
functiononSocketRecv virtualCalled when data is received from the socket. Forwards the event to all registered receivers in priority order.
functiononSocketError virtualCalled when the socket encounters an error. Forwards the event to all registered receivers in priority order.
functiononSocketClose virtualCalled when the socket is closed. Forwards the event to all registered receivers in priority order.
variable_sender
variable_receivers
variable_dirty
functioncleanupReceivers virtual

Public Attributes

ReturnNameDescription
LocalSignal< void(const net::TCPSocket::Ptr &)>AcceptConnectionFired when a new client connection is accepted; carries a shared_ptr to the new socket.

AcceptConnection

LocalSignal< void(const net::TCPSocket::Ptr &)> AcceptConnection

Defined in src/net/include/icy/net/tcpsocket.h:149

Fired when a new client connection is accepted; carries a shared_ptr to the new socket.

Public Methods

ReturnNameDescription
TCPSocketConstructs the TCPSocket and initializes the underlying libuv handle.
TCPSocketDeleted constructor.
TCPSocketDeleted constructor.
boolshutdown virtual overrideSends a TCP shutdown request; the socket closes after the peer acknowledges.
voidclose virtual overrideCloses the socket immediately, releasing all associated resources.
voidconnect virtual overrideConnects to peerAddress using a libuv connect request. On success, calls onConnect(); on failure, calls setUVError().
voidconnect virtual overrideResolves host via DNS (or maps "localhost"), then connects.
ssize_tsend virtual overrideWrites len bytes to the connected peer.
ssize_tsendOwned virtual overrideSends an owned payload buffer to the connected peer.
ssize_tsend virtual overrideWrites len bytes; peerAddress is ignored for TCP (connected stream).
ssize_tsendOwned virtual override
voidbind virtual overrideBinds the socket to address. Resets and reinitializes the handle if the address family changes.
voidlisten virtual overrideStarts listening for incoming connections with the given backlog.
voidacceptConnection virtualAccepts the next pending client connection and fires AcceptConnection.
boolsetReusePortEnables SO_REUSEPORT on Linux kernel >= 3.9 for multi-thread load balancing. Must be called after bind(). No-op and returns false on unsupported platforms.
boolsetNoDelayEnables or disables TCP_NODELAY (Nagle's algorithm).
boolsetKeepAliveEnables or disables TCP keep-alive probes.
boolsetSimultaneousAcceptsEnables or disables simultaneous accepts on Windows. No-op and returns false on non-Windows platforms.
voidsetModeSets the socket mode (ServerSide or ClientSide).
SocketModemode constReturns the current socket mode.
voidsetError virtual overrideSets the socket error; ignores the call if an error is already recorded. Setting an error causes the socket to close.
const icy::Error &error virtual const overrideReturns the current socket error, if any.
boolclosed virtual const overrideReturns true if the native socket handle is closed.
net::Addressaddress virtual const overrideReturns the IP address and port number of the socket. A wildcard address is returned if the socket is not connected.
net::AddresspeerAddress virtual const overrideReturns the IP address and port number of the peer socket. A wildcard address is returned if the socket is not connected.
net::TransportTypetransport virtual const overrideReturns the TCP transport protocol.
uv::Loop *loop virtual const overrideReturns the event loop associated with this socket.
voidonConnect virtualCalled by the stream layer when the TCP connection is established.
voidonRead virtual overrideCalled by the stream layer with raw received bytes; wraps them in a MutableBuffer.
voidonRecv virtualDispatches a received buffer to all socket adapters via onSocketRecv.
voidonError virtual overrideDispatches the error to adapters and closes the socket.
voidonClose virtual overrideDispatches the close event to all socket adapters.

TCPSocket

TCPSocket(uv::Loop * loop = uv::defaultLoop())

Defined in src/net/include/icy/net/tcpsocket.h:39

Constructs the TCPSocket and initializes the underlying libuv handle.

Parameters

  • loop Event loop to use; defaults to the default loop.

TCPSocket

TCPSocket(const TCPSocket &) = delete

Defined in src/net/include/icy/net/tcpsocket.h:42

Deleted constructor.


TCPSocket

TCPSocket(TCPSocket &&) = delete

Defined in src/net/include/icy/net/tcpsocket.h:44

Deleted constructor.


shutdown

virtual override

virtual bool shutdown() override

Defined in src/net/include/icy/net/tcpsocket.h:49

Sends a TCP shutdown request; the socket closes after the peer acknowledges.

Returns

true if the shutdown request was queued successfully.

Reimplements

close

virtual override

virtual void close() override

Defined in src/net/include/icy/net/tcpsocket.h:52

Closes the socket immediately, releasing all associated resources.

Reimplements
Reimplemented by

connect

virtual override

virtual void connect(const net::Address & peerAddress) override

Defined in src/net/include/icy/net/tcpsocket.h:57

Connects to peerAddress using a libuv connect request. On success, calls onConnect(); on failure, calls setUVError().

Parameters

  • peerAddress The remote address to connect to.
Reimplements
Reimplemented by

connect

virtual override

virtual void connect(std::string_view host, uint16_t port) override

Defined in src/net/include/icy/net/tcpsocket.h:62

Resolves host via DNS (or maps "localhost"), then connects.

Parameters

  • host Hostname or IP address string.

  • port Destination port.

Reimplements
Reimplemented by

send

virtual override

virtual ssize_t send(const char * data, size_t len, int flags = 0) override

Defined in src/net/include/icy/net/tcpsocket.h:69

Writes len bytes to the connected peer.

Parameters

  • data Pointer to the data to send.

  • len Number of bytes to send.

  • flags Reserved; currently unused.

Returns

Number of bytes sent, or -1 on error.

Reimplements
Reimplemented by

sendOwned

virtual override

virtual ssize_t sendOwned(Buffer && buffer, int flags = 0) override

Defined in src/net/include/icy/net/tcpsocket.h:70

Sends an owned payload buffer to the connected peer.

Reimplements
Reimplemented by

send

virtual override

virtual ssize_t send(const char * data, size_t len, const net::Address & peerAddress, int flags = 0) override

Defined in src/net/include/icy/net/tcpsocket.h:78

Writes len bytes; peerAddress is ignored for TCP (connected stream).

Parameters

  • data Pointer to the data to send.

  • len Number of bytes to send.

  • peerAddress Ignored; present for interface conformance.

  • flags Reserved; currently unused.

Returns

Number of bytes sent, or -1 on error.

Reimplements
Reimplemented by

sendOwned

virtual override

virtual ssize_t sendOwned(Buffer && buffer, const net::Address & peerAddress, int flags = 0) override

Defined in src/net/include/icy/net/tcpsocket.h:79

Reimplements
Reimplemented by

bind

virtual override

virtual void bind(const net::Address & address, unsigned flags = 0) override

Defined in src/net/include/icy/net/tcpsocket.h:85

Binds the socket to address. Resets and reinitializes the handle if the address family changes.

Parameters

  • address Local address to bind to.

  • flags Optional bind flags (e.g. UV_TCP_IPV6ONLY is added automatically for IPv6).

Reimplements
Reimplemented by

listen

virtual override

virtual void listen(int backlog = 64) override

Defined in src/net/include/icy/net/tcpsocket.h:89

Starts listening for incoming connections with the given backlog.

Parameters

  • backlog Maximum length of the pending connection queue.
Reimplements
Reimplemented by

acceptConnection

virtual

virtual void acceptConnection()

Defined in src/net/include/icy/net/tcpsocket.h:92

Accepts the next pending client connection and fires AcceptConnection.

Reimplemented by

setReusePort

bool setReusePort()

Defined in src/net/include/icy/net/tcpsocket.h:97

Enables SO_REUSEPORT on Linux kernel >= 3.9 for multi-thread load balancing. Must be called after bind(). No-op and returns false on unsupported platforms.

Returns

true if the socket option was set successfully.


setNoDelay

bool setNoDelay(bool enable)

Defined in src/net/include/icy/net/tcpsocket.h:102

Enables or disables TCP_NODELAY (Nagle's algorithm).

Parameters

  • enable true to disable Nagle's algorithm (lower latency).

Returns

true if the option was set successfully.


setKeepAlive

bool setKeepAlive(bool enable, int delay)

Defined in src/net/include/icy/net/tcpsocket.h:108

Enables or disables TCP keep-alive probes.

Parameters

  • enable true to enable keep-alive.

  • delay Initial delay in seconds before the first keep-alive probe.

Returns

true if the option was set successfully.


setSimultaneousAccepts

bool setSimultaneousAccepts(bool enable)

Defined in src/net/include/icy/net/tcpsocket.h:114

Enables or disables simultaneous accepts on Windows. No-op and returns false on non-Windows platforms.

Parameters

  • enable true to enable simultaneous accepts.

Returns

true if the option was set successfully.


setMode

void setMode(SocketMode mode)

Defined in src/net/include/icy/net/tcpsocket.h:118

Sets the socket mode (ServerSide or ClientSide).

Parameters

  • mode The mode to assign.

mode

const

SocketMode mode() const

Defined in src/net/include/icy/net/tcpsocket.h:121

Returns the current socket mode.


setError

virtual override

virtual void setError(const icy::Error & err) override

Defined in src/net/include/icy/net/tcpsocket.h:126

Sets the socket error; ignores the call if an error is already recorded. Setting an error causes the socket to close.

Parameters

  • err The error to record.
Reimplements

error

virtual const override

virtual const icy::Error & error() const override

Defined in src/net/include/icy/net/tcpsocket.h:129

Returns the current socket error, if any.

Reimplements

closed

virtual const override

virtual bool closed() const override

Defined in src/net/include/icy/net/tcpsocket.h:132

Returns true if the native socket handle is closed.

Reimplements

address

virtual const override

virtual net::Address address() const override

Defined in src/net/include/icy/net/tcpsocket.h:136

Returns the IP address and port number of the socket. A wildcard address is returned if the socket is not connected.

Reimplements

peerAddress

virtual const override

virtual net::Address peerAddress() const override

Defined in src/net/include/icy/net/tcpsocket.h:140

Returns the IP address and port number of the peer socket. A wildcard address is returned if the socket is not connected.

Reimplements

transport

virtual const override

virtual net::TransportType transport() const override

Defined in src/net/include/icy/net/tcpsocket.h:143

Returns the TCP transport protocol.

Reimplements

loop

virtual const override

virtual uv::Loop * loop() const override

Defined in src/net/include/icy/net/tcpsocket.h:146

Returns the event loop associated with this socket.

Reimplements

onConnect

virtual

virtual void onConnect()

Defined in src/net/include/icy/net/tcpsocket.h:153

Called by the stream layer when the TCP connection is established.

Reimplemented by

onRead

virtual override

virtual void onRead(const char * data, size_t len) override

Defined in src/net/include/icy/net/tcpsocket.h:158

Called by the stream layer with raw received bytes; wraps them in a MutableBuffer.

Parameters

  • data Pointer to received bytes.

  • len Number of bytes received.

Reimplements
Reimplemented by

onRecv

virtual

virtual void onRecv(const MutableBuffer & buf)

Defined in src/net/include/icy/net/tcpsocket.h:162

Dispatches a received buffer to all socket adapters via onSocketRecv.

Parameters

  • buf The buffer containing the received data.

onError

virtual override

virtual void onError(const icy::Error & error) override

Defined in src/net/include/icy/net/tcpsocket.h:166

Dispatches the error to adapters and closes the socket.

Parameters

  • error The error that occurred.
Reimplements

onClose

virtual override

virtual void onClose() override

Defined in src/net/include/icy/net/tcpsocket.h:169

Dispatches the close event to all socket adapters.

Reimplements

Protected Attributes

ReturnNameDescription
SocketMode_mode
net::Address_peerAddressCached peer address (avoids syscall per recv)

_mode

SocketMode _mode

Defined in src/net/include/icy/net/tcpsocket.h:175


_peerAddress

net::Address _peerAddress

Defined in src/net/include/icy/net/tcpsocket.h:176

Cached peer address (avoids syscall per recv)

Protected Methods

ReturnNameDescription
voidinit virtual overrideInitializes the underlying socket context.
voidreset virtual overrideResets the socket context for reuse.

init

virtual override

virtual void init() override

Defined in src/net/include/icy/net/tcpsocket.h:172

Initializes the underlying socket context.

Reimplements

reset

virtual override

virtual void reset() override

Defined in src/net/include/icy/net/tcpsocket.h:173

Resets the socket context for reuse.

Reimplements

Public Types

NameDescription
Ptr
Vec

Ptr

using Ptr = std::shared_ptr< TCPSocket >

Defined in src/net/include/icy/net/tcpsocket.h:34


Vec

using Vec = std::vector< Ptr >

Defined in src/net/include/icy/net/tcpsocket.h:35