remove NetStat.sigar member, pass in to each stat()

This commit is contained in:
Doug MacEachern 2006-07-11 01:02:59 +00:00
parent 068e85880f
commit f3b9a4a1c6
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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()