Function ConnectedDatagramSocket.connect

Create a stream socket and connect, as client, to the address supplied

static ConnectedDatagramSocket connect (
  SockAddr sa,
  Timeout timeout = Timeout(TscTimePoint(9223372036854775807L))
) @nogc @safe;

static ConnectedDatagramSocket connect (
  SockAddrUnix sa,
  Timeout timeout = Timeout(TscTimePoint(9223372036854775807L))
) @nogc @safe;

This creates a SOCK_SEQPACKET socket. It connects it to the designated server specified in sa, and waits, through the reactor, for the connection to be established.

Parameters

NameDescription
sa a socket address for the server to connect to.
timeout the timeout for the connection. Throws TimeoutExpired if the timeout expires

Returns

Returns the connected socket.

Throws

TimeoutExpired if the timeout expires

ErrnoException if the connection fails (e.g. - ECONNREFUSED if connecting to a non-listening port). Also throws this if one of the system calls fails.

Anything else: May throw any exception injected using throwInFiber.