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 {
|
public class NetStat {
|
||||||
|
|
||||||
protected Sigar sigar;
|
|
||||||
|
|
||||||
protected int[] tcpStates;
|
protected int[] tcpStates;
|
||||||
protected int tcpInboundTotal, tcpOutboundTotal;
|
protected int tcpInboundTotal, tcpOutboundTotal;
|
||||||
|
|
||||||
public native void stat(Sigar sigar, int flags) throws SigarException;
|
public native void stat(Sigar sigar, int flags) throws SigarException;
|
||||||
|
|
||||||
public NetStat(Sigar sigar) throws SigarException {
|
public NetStat() { }
|
||||||
this.sigar = sigar;
|
|
||||||
|
|
||||||
|
public void stat(Sigar sigar) throws SigarException {
|
||||||
int flags =
|
int flags =
|
||||||
NetFlags.CONN_SERVER | NetFlags.CONN_CLIENT |
|
NetFlags.CONN_SERVER | NetFlags.CONN_CLIENT |
|
||||||
NetFlags.CONN_TCP;
|
NetFlags.CONN_TCP;
|
||||||
|
@ -689,7 +689,9 @@ public class Sigar implements SigarProxy {
|
|||||||
|
|
||||||
public NetStat getNetStat()
|
public NetStat getNetStat()
|
||||||
throws SigarException {
|
throws SigarException {
|
||||||
return new NetStat(this);
|
NetStat netstat = new NetStat();
|
||||||
|
netstat.stat(this);
|
||||||
|
return netstat;
|
||||||
}
|
}
|
||||||
|
|
||||||
public native Who[] getWhoList()
|
public native Who[] getWhoList()
|
||||||
|
Loading…
Reference in New Issue
Block a user