UdpSocket.bind

int bind(ref EventLoop loop, scope const(char)[] host, ushort port) @trusted

Bind the socket to a local endpoint.

On success, EVE owns the socket fd — the caller must not close it directly. Must eventually call close() or dispose(). On failure, no cleanup required.

Parameters

loopEvent loop to register with.
hostLocal address to bind to (e.g., "0.0.0.0" or "::").
portPort number to bind to (0 for ephemeral).

Returns

0 on success, or -1 with errno set.