TSocketBase

Common parts of a socket TTransport implementation, regardless of how the actual I/O is performed (sync/async).

Constructors

this
this(Socket socket)

Constructor that takes an already created, connected (!) socket.

this
this(string host, ushort port)

Creates a new unconnected socket that will connect to the given host on the given port.

Members

Functions

getPeerAddress
Address getPeerAddress()

Returns the actual address of the peer the socket is connected to.

host
string host()

The host the socket is connected to or will connect to. Null if an already connected socket was used to construct the object.

isOpen
bool isOpen()

Checks whether the socket is connected.

port
ushort port()

The port the socket is connected to or will connect to. Zero if an already connected socket was used to construct the object.

recvTimeout
Duration recvTimeout()
void recvTimeout(Duration value)

The socket receiving timeout. Values smaller than 500 ms are not supported on Windows.

sendTimeout
Duration sendTimeout()
void sendTimeout(Duration value)

The socket send timeout.

setSocketOpts
void setSocketOpts()

Sets the needed socket options.

socketHandle
typeof(socket_.handle()) socketHandle()

Returns the OS handle of the underlying socket.

writeSome
size_t writeSome(ubyte[] buf)

Writes as much data to the socket as there can be in a single OS call.

Variables

host_
string host_;

Remote host.

peerAddress_
Address peerAddress_;

Cached peer address.

peerHost_
string peerHost_;

Cached peer host name.

peerPort_
ushort peerPort_;

Cached peer port.

port_
ushort port_;

Remote port.

recvTimeout_
Duration recvTimeout_;

Timeout for receiving.

sendTimeout_
Duration sendTimeout_;

Timeout for sending.

socket_
Socket socket_;

Wrapped socket object.

Inherited Members

From TBaseTransport

isOpen
bool isOpen()
Undocumented in source. Be warned that the author may not have intended to support it.
peek
bool peek()
Undocumented in source. Be warned that the author may not have intended to support it.
open
void open()
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.
read
size_t read(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
readAll
void readAll(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
readEnd
size_t readEnd()
Undocumented in source. Be warned that the author may not have intended to support it.
write
void write(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
writeEnd
size_t writeEnd()
Undocumented in source. Be warned that the author may not have intended to support it.
flush
void flush()
Undocumented in source. Be warned that the author may not have intended to support it.
borrow
const(ubyte)[] borrow(ubyte* buf, size_t len)
Undocumented in source. Be warned that the author may not have intended to support it.
consume
void consume(size_t len)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta