InetAddress address = InetAddress.getByName(addr);
traceln("");
traceln("using address=" + address + ":" + port);
NetStat netstat;
try {
netstat = sigar.getNetStat(address.getAddress(), port);
} catch (SigarNotImplementedException e) {
return;
} catch (SigarPermissionDeniedException e) {
return;
}
assertGtEqZeroTrace("AllOutbound", netstat.getAllOutboundTotal());
assertGtEqZeroTrace("Outbound", netstat.getTcpOutboundTotal());
assertGtEqZeroTrace("Inbound", netstat.getTcpInboundTotal());
assertGtEqZeroTrace("AllInbound", netstat.getAllInboundTotal());
int[] states = netstat.getTcpStates();
for (int i=0; i<NetFlags.TCP_UNKNOWN; i++) {
assertGtEqZeroTrace(NetConnection.getStateString(i), states[i]);
}
}