TServerSocket

Server socket implementation of TServerTransport.

Maps to std.socket listen()/accept(); only provides TCP/IP sockets (i.e. no Unix sockets) for now, because they are not supported in std.socket.

Constructors

this
this(ushort port, Duration sendTimeout, Duration recvTimeout)

Constructs a new instance.

Members

Functions

accept
TTransport accept(TCancellation cancellation)
Undocumented in source. Be warned that the author may not have intended to support it.
close
void close()
Undocumented in source. Be warned that the author may not have intended to support it.
createTSocket
TSocket createTSocket(Socket socket)

Allows derived classes to create a different TSocket type.

ipv6Only
void ipv6Only(bool value)

Whether to listen on IPv6 only, if IPv6 support is detected (default: false).

isListening
bool isListening()
Undocumented in source. Be warned that the author may not have intended to support it.
listen
void listen()
Undocumented in source. Be warned that the author may not have intended to support it.
port
ushort port()

The port the server socket listens at.

recvTimeout
void recvTimeout(Duration recvTimeout)

The socket receiving timeout, zero to block infinitely.

retryDelay
void retryDelay(Duration retryDelay)

The delay between a listening attempt failing and retrying it.

retryLimit
void retryLimit(ushort retryLimit)

The maximum number of listening retries if it fails.

sendTimeout
void sendTimeout(Duration sendTimeout)

The socket sending timeout, zero to block infinitely.

tcpRecvBuffer
void tcpRecvBuffer(int tcpRecvBuffer)

The size of the TCP receiving buffer, in bytes.

tcpSendBuffer
void tcpSendBuffer(int tcpSendBuffer)

The size of the TCP send buffer, in bytes.

Manifest constants

ACCEPT_BACKLOG
enum ACCEPT_BACKLOG;

Number of connections listen() backlogs.

Inherited Members

From TServerTransport

listen
void listen()

Starts listening for server connections.

close
void close()

Closes the server transport, causing it to stop listening.

isListening
bool isListening()

Returns whether the server transport is currently listening.

accept
TTransport accept(TCancellation cancellation)

Accepts a client connection and returns an opened TTransport for it, never returning null.

Meta