remove NetStat.sigar member, pass in to each stat()
This commit is contained in:
parent
068e85880f
commit
f3b9a4a1c6
|
@ -2,16 +2,14 @@ package org.hyperic.sigar;
|
|||
|
||||
public class NetStat {
|
||||
|
||||
protected Sigar sigar;
|
||||
|
||||
protected int[] tcpStates;
|
||||
protected int tcpInboundTotal, tcpOutboundTotal;
|
||||
|
||||
public native void stat(Sigar sigar, int flags) throws SigarException;
|
||||
|
||||
public NetStat(Sigar sigar) throws SigarException {
|
||||
this.sigar = sigar;
|
||||
public NetStat() { }
|
||||
|
||||
public void stat(Sigar sigar) throws SigarException {
|
||||
int flags =
|
||||
NetFlags.CONN_SERVER | NetFlags.CONN_CLIENT |
|
||||
NetFlags.CONN_TCP;
|
||||
|
|
|
@ -689,7 +689,9 @@ public class Sigar implements SigarProxy {
|
|||
|
||||
public NetStat getNetStat()
|
||||
throws SigarException {
|
||||
return new NetStat(this);
|
||||
NetStat netstat = new NetStat();
|
||||
netstat.stat(this);
|
||||
return netstat;
|
||||
}
|
||||
|
||||
public native Who[] getWhoList()
|
||||
|
|
Loading…
Reference in New Issue