Skip to main content

1E 23.11 (SaaS)

Network.GetConnections

Method

GetConnections

Module

Network

Library

Core

Action

Get current established TCP connections, for IPv4 and also IPv6 if available.

Parameters

(None)

Return values

For each connection:

  • Class (string): "IPv4" or "IPv6".

  • LatencyMs (int): The smoothed round trip time in milliseconds from sending a packet to getting a response for this connection.

  • LocalAddress (string): The IP address on this host.

  • LocalPort (int): The port on this host.

  • PacketLossPercent (int): The amount of packets lost or discarded vs the number of packets sent and received successfully as a percentage.

  • ProcessId (int): The PID of the process associated with the connection.

  • ProcessName (string): The name of the process associated with the connection.

  • RemoteAddress (string): The IP address on the remote host for an active outgoing connection; null if only listening.

  • RemotePort (int): The port on the remote host for an active outgoing connection; null if only listening.

Example

Network.GetConnections();

Platforms

  • Windows

  • Linux

  • MacOS

Notes

Use Network.GetListeningEndpoints for the ports which are listening for incoming connections.

LatencyMs and PacketLossPercent are null on every platform but Windows. Even on WindowsPacketLossPercent is always null as this information is never non-zero, even in Windows' own Network Resource Monitor. (The performance counter information is not gathered, presumably for performance reasons.)