LocalSocket

A wrapper around the Berkeley API to implement the IConduit abstraction and add stream-specific functionality.

Constructors

this
this(const(char)[] path)

Create a streaming local socket

this
this(LocalAddress addr)

Create a streaming local socket

Members

Functions

toString
immutable(char)[] toString()

Return the name of this device

Inherited Members

From Socket

socket
alias socket = native
Undocumented in source.
setTimeout
deprecated void setTimeout(double t)

see super.timeout(int)

hadTimeout
deprecated bool hadTimeout()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()

Return the name of this device

fileHandle
Handle fileHandle [@property getter]

Models a handle-oriented device.

native
Berkeley* native [@property getter]

Return the socket wrapper

bufferSize
size_t bufferSize [@property getter]

Return a preferred size for buffering conduit I/O

connect
Socket connect(const(char)[] address, uint port)

Connect to the provided endpoint

connect
Socket connect(Address addr)

Connect to the provided endpoint

bind
Socket bind(Address address)

Bind this socket. This is typically used to configure a listening socket (such as a server or multicast socket). The address given should describe a local adapter, or specify the port alone (ADDR_ANY) to have the OS assign a local adapter address.

shutdown
Socket shutdown()

Inform other end of a connected socket that we're no longer available. In general, this should be invoked before close()

detach
void detach()

Release this Socket

read
size_t read(void[] dst)

Read content from the socket. Note that the operation may timeout if method setTimeout() has been invoked with a non-zero value.

write
size_t write(const(void)[] src)
copy
OutputStream copy(InputStream src, size_t max)

Transfer the content of another conduit to this one. Returns the dst OutputStream, or throws IOException on failure.

wait
bool wait(bool reading)

Manage socket IO under a timeout

error
void error()

Throw an IOException noting the last error

asyncCopy
Socket asyncCopy(Handle file)

Meta