Process.connections

NetConnection[] connections(string kind = "inet") @trusted

Gets network connections for this process.

Parameters

kindType of connections to retrieve ("inet", "inet4", "inet6", "tcp", "tcp4", "tcp6", "udp", "udp4", "udp6", "unix").

Returns

Array of NetConnection structs.

Throws

AccessDenied if access is denied.

Example:

auto proc = Process.current();
auto conns = proc.connections("inet");
writeln("Connections: ", conns.length);