udp connections have no state
This commit is contained in:
parent
91b3efc822
commit
4f7a9ccb80
|
@ -125,6 +125,15 @@ public class Netstat extends SigarCommandBase {
|
||||||
for (int i=0; i<connections.length; i++) {
|
for (int i=0; i<connections.length; i++) {
|
||||||
NetConnection conn = connections[i];
|
NetConnection conn = connections[i];
|
||||||
String proto = conn.getTypeString();
|
String proto = conn.getTypeString();
|
||||||
|
String state;
|
||||||
|
|
||||||
|
if (conn.getType() == NetFlags.CONN_UDP) {
|
||||||
|
state = "";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
state = conn.getStateString();
|
||||||
|
}
|
||||||
|
|
||||||
println(proto +
|
println(proto +
|
||||||
"\t" +
|
"\t" +
|
||||||
formatAddress(conn.getLocalAddress()) + ":" +
|
formatAddress(conn.getLocalAddress()) + ":" +
|
||||||
|
@ -132,7 +141,7 @@ public class Netstat extends SigarCommandBase {
|
||||||
"\t" +
|
"\t" +
|
||||||
formatAddress(conn.getRemoteAddress()) + ":" +
|
formatAddress(conn.getRemoteAddress()) + ":" +
|
||||||
formatPort(proto, conn.getRemotePort()) + "\t" +
|
formatPort(proto, conn.getRemotePort()) + "\t" +
|
||||||
conn.getStateString());
|
state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue