java.lang.Object
oshi.driver.unix.NetStat
Utility to query TCP connections
-
Method Summary
Modifier and TypeMethodDescriptionQuery netstat to all TCP and UDP connectionsQuery netstat to obtain number of established TCP connectionsqueryTcpStats
(String netstatStr) Gets TCP stats vianetstat -s
.queryUdpStats
(String netstatStr) Gets UDP stats vianetstat -s
.
-
Method Details
-
queryTcpnetstat
Query netstat to obtain number of established TCP connections- Returns:
- A pair with number of established IPv4 and IPv6 connections
-
queryNetstat
Query netstat to all TCP and UDP connections- Returns:
- A list of TCP and UDP connections
-
queryTcpStats
Gets TCP stats vianetstat -s
. Used for Linux and OpenBSD formats- Parameters:
netstatStr
- The command string- Returns:
- The statistics
-
queryUdpStats
Gets UDP stats vianetstat -s
. Used for Linux and OpenBSD formats- Parameters:
netstatStr
- The command string- Returns:
- The statistics
-