print state

This commit is contained in:
Doug MacEachern 2005-03-11 17:16:07 +00:00
parent 98761935f7
commit 91b3efc822
1 changed files with 3 additions and 2 deletions

View File

@ -120,7 +120,7 @@ public class Netstat extends SigarCommandBase {
} }
NetConnection[] connections = this.sigar.getNetConnectionList(flags); NetConnection[] connections = this.sigar.getNetConnectionList(flags);
println("Proto\tLocal Address\tForeign Address"); println("Proto\tLocal Address\tForeign Address\tState");
for (int i=0; i<connections.length; i++) { for (int i=0; i<connections.length; i++) {
NetConnection conn = connections[i]; NetConnection conn = connections[i];
@ -131,7 +131,8 @@ public class Netstat extends SigarCommandBase {
formatPort(proto, conn.getLocalPort()) + formatPort(proto, conn.getLocalPort()) +
"\t" + "\t" +
formatAddress(conn.getRemoteAddress()) + ":" + formatAddress(conn.getRemoteAddress()) + ":" +
formatPort(proto, conn.getRemotePort())); formatPort(proto, conn.getRemotePort()) + "\t" +
conn.getStateString());
} }
} }