ConnectedSocket

Socket returned if a connection has been established.

Constructors

this
this(socket_t handle, AddressFamily af)

Create a socket.

Members

Functions

receive
ptrdiff_t receive(ubyte[] buf, Flags flags)

Receive data on the connection.

send
ptrdiff_t send(const(ubyte)[] buf, Flags flags)

Send data on the connection. If the socket is blocking and there is no buffer space left, $(D_PSYMBOL send) waits, non-blocking socket returns 0 in this case.

Properties

disconnected
inout(bool) disconnected [@property getter]

Variables

disconnected_
bool disconnected_;

$(D_KEYWORD true) if the stream socket peer has performed an orderly shutdown.

Inherited Members

From Socket

Shutdown
enum Shutdown

How a socket is shutdown.

Shutdown
enum Shutdown

How a socket is shutdown.

handle_
socket_t handle_;

Socket handle.

family
AddressFamily family;

Address family.

handle
inout(socket_t) handle [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
~this
~this()

Closes the socket and calls the destructor on itself.

getOption
int getOption(SocketOptionLevel level, SocketOption option, void[] result)
int getOption(SocketOptionLevel level, SocketOption option, size_t result)
int getOption(SocketOptionLevel level, SocketOption option, Linger result)
int getOption(SocketOptionLevel level, SocketOption option, Duration result)

Get a socket option.

setOption
void setOption(SocketOptionLevel level, SocketOption option, void[] value)
void setOption(SocketOptionLevel level, SocketOption option, size_t value)
void setOption(SocketOptionLevel level, SocketOption option, Linger value)
void setOption(SocketOptionLevel level, SocketOption option, Duration value)

Set a socket option.

blocking
inout(bool) blocking [@property getter]
blocking
bool blocking [@property setter]
addressFamily
AddressFamily addressFamily [@property getter]
isAlive
bool isAlive [@property getter]
shutdown
void shutdown(Shutdown how)

Disables sends and/or receives.

close
void close()

Immediately drop any connections and release socket resources. Calling $(D_PSYMBOL shutdown) before $(D_PSYMBOL close) is recommended for connection-oriented sockets. The $(D_PSYMBOL Socket) object is no longer usable after $(D_PSYMBOL close).

listen
void listen(int backlog)

Listen for an incoming connection. $(D_PSYMBOL bind) must be called before you can $(D_PSYMBOL listen).

opCmp
int opCmp(size_t that)

Compare handles.

From ConnectionOrientedSocket

Flag
enum Flag

Flags may be OR'ed together.

Flags
alias Flags = BitFlags!Flag
Undocumented in source.

Meta