public class PeerInfo
extends java.lang.Object
This class is a lightweight version of the native peer_info, and
only carries a subset of all the information. However, it's completely open
for custom use or optimization to accommodate client necessities.
| Modifier and Type | Class and Description |
|---|---|
static class |
PeerInfo.ConnectionType
The kind of connection this is.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
client |
protected PeerInfo.ConnectionType |
connectionType |
protected int |
downSpeed |
protected int |
flags |
protected java.lang.String |
ip |
protected float |
progress |
protected int |
progressPpm |
protected byte |
source |
protected long |
totalDownload |
protected long |
totalUpload |
protected int |
upSpeed |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
client()
This describe the software at the other end of the connection.
|
PeerInfo.ConnectionType |
connectionType()
The kind of connection this peer uses.
|
int |
downSpeed()
The current download speed we have to and from this peer
(including any protocol messages).
|
int |
flags()
Tells you in which state the peer is in.
|
protected void |
init(peer_info p)
NOTE: use this with care and only if necessary.
|
java.lang.String |
ip()
The IP-address to this peer.
|
float |
progress()
The progress of the peer in the range [0, 1].
|
int |
progressPpm()
Indicates the download progress of the peer in the range [0, 1000000]
(parts per million).
|
byte |
source()
A combination of flags describing from which sources this peer
was received.
|
long |
totalDownload()
The total number of bytes downloaded from this peer.
|
long |
totalUpload()
The total number of bytes uploaded to this peer.
|
int |
upSpeed()
The current upload speed we have to and from this peer
(including any protocol messages).
|
protected java.lang.String client
protected long totalDownload
protected long totalUpload
protected int flags
protected byte source
protected int upSpeed
protected int downSpeed
protected PeerInfo.ConnectionType connectionType
protected float progress
protected int progressPpm
protected java.lang.String ip
public PeerInfo(peer_info p)
public java.lang.String client()
public long totalDownload()
public long totalUpload()
public int flags()
public byte source()
public int upSpeed()
public int downSpeed()
public PeerInfo.ConnectionType connectionType()
public float progress()
public int progressPpm()
public java.lang.String ip()
protected void init(peer_info p)
p - the native object