vibe.core.net

TCP/UDP connection and server handling.

Members

Aliases

TCPConnectionDelegate
alias TCPConnectionDelegate = void delegate(TCPConnection stream)
TCPConnectionFunction
alias TCPConnectionFunction = void function(TCPConnection stream)

Callback invoked for incoming TCP connections.

Classes

ReadTimeoutException
class ReadTimeoutException

Thrown by TCPConnection read-alike operations when timeout is reached.

Enums

TCPListenOptions
enum TCPListenOptions

Flags to control the behavior of listenTCP.

WaitForDataAsyncStatus
enum WaitForDataAsyncStatus

Represents possible return values for TCPConnection.waitForDataAsync.

WaitForDataStatus
enum WaitForDataStatus
Undocumented in source.

Functions

anyAddress
NetworkAddress anyAddress()
Undocumented in source. Be warned that the author may not have intended to support it.
connectTCP
TCPConnection connectTCP(string host, ushort port, string bind_interface, ushort bind_port, Duration timeout)
TCPConnection connectTCP(NetworkAddress addr, NetworkAddress bind_address, Duration timeout)

Establishes a connection to the given host/port.

listenTCP
TCPListener[] listenTCP(ushort port, TCPConnectionDelegate connection_callback, TCPListenOptions options)
TCPListener listenTCP(ushort port, TCPConnectionDelegate connection_callback, string address, TCPListenOptions options)

Starts listening on the specified port.

listenTCP
deprecated TCPListener[] listenTCP(ushort port, void delegate(TCPConnection) connection_callback, TCPListenOptions options)
deprecated TCPListener listenTCP(ushort port, void delegate(TCPConnection) connection_callback, string address, TCPListenOptions options)

Compatibility overload - use an @safe nothrow callback instead.

listenTCP_s
TCPListener[] listenTCP_s(ushort port, TCPConnectionFunction connection_callback, TCPListenOptions options)
TCPListener listenTCP_s(ushort port, TCPConnectionFunction connection_callback, string address, TCPListenOptions options)

Starts listening on the specified port.

listenUDP
UDPConnection listenUDP(NetworkAddress addr)
UDPConnection listenUDP(ushort port, string bind_address)

Creates a bound UDP socket suitable for sending and receiving packets.

resolveHost
NetworkAddress resolveHost(string host, AddressFamily address_family, bool use_dns)
NetworkAddress resolveHost(string host, ushort address_family, bool use_dns)

Resolves the given host name/IP address string.

Mixins

__anonymous
mixin validateConnectionStream!TCPConnection
Undocumented in source.

Structs

NetworkAddress
struct NetworkAddress

Represents a network/socket address.

TCPConnection
struct TCPConnection

Represents a single TCP connection.

TCPListener
struct TCPListener

Represents a listening TCP socket.

UDPConnection
struct UDPConnection

Represents a bound and possibly 'connected' UDP socket.

Meta

Authors

Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.