Class Socket

Class for creating a network communication endpoint using the Berkeley sockets interfaces of different types.

class Socket ;

Constructors

NameDescription
this (handle, af) Create a socket.

Fields

NameTypeDescription
family AddressFamilyAddress family.
handle_ tanya.network.socket.SocketTypeSocket handle.

Properties

NameTypeDescription
addressFamily[get] AddressFamily
blocking[get] inout(bool)
blocking[set] bool
isAlive[get] bool

Methods

NameDescription
close () Immediately drop any connections and release socket resources. Calling shutdown before close is recommended for connection-oriented sockets. The Socket object is no longer usable after close.
getOption (level, option, result) Ditto.
listen (backlog) Listen for an incoming connection. bind must be called before you can listen.
opCmp (that) Compare handles.
setOption (level, option, value) Ditto.
shutdown (how) Disables sends and/or receives.
getOption (level, option, result) Get a socket option.
setOption (level, option, value) Set a socket option.

Enums

NameDescription
Shutdown How a socket is shutdown.