Package com.biglybt.plugin.net.netstatus
Class NetStatusProtocolTesterBT
- java.lang.Object
-
- com.biglybt.plugin.net.netstatus.NetStatusProtocolTesterBT
-
public class NetStatusProtocolTesterBT extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
NetStatusProtocolTesterBT.Session
-
Field Summary
Fields Modifier and Type Field Description private AESemaphore
completion_sem
private boolean
destroyed
private java.net.InetAddress
explicit_bind
private int
inbound_connects
private CopyOnWriteList
listeners
private byte[]
my_hash
private int
outbound_attempts
private boolean
outbound_connections_complete
private int
outbound_connects
private byte[]
peer_id
private PeerManagerRegistration
pm_reg
private static java.util.Random
random
private int
session_id_next
private java.util.List
sessions
private long
start_time
private boolean
test_initiator
private NetStatusProtocolTester
tester
-
Constructor Summary
Constructors Modifier Constructor Description protected
NetStatusProtocolTesterBT(NetStatusProtocolTester _tester, boolean _test_initiator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(NetStatusProtocolTesterListener l)
protected void
checkCompletion()
void
destroy()
int
getInboundConnects()
int
getOutboundConnects()
protected byte[]
getServerHash()
protected long
getStartTime(long now)
java.lang.String
getStatus()
protected boolean
isDestroyed()
protected void
log(java.lang.String str)
protected void
log(java.lang.String str, boolean detailed)
protected void
logError(java.lang.String str)
protected void
logError(java.lang.String str, java.lang.Throwable e)
void
removeListener(NetStatusProtocolTesterListener l)
void
setBindIP(java.net.InetAddress a)
void
setOutboundConnectionsComplete()
protected void
start()
protected void
testOutbound(java.net.InetSocketAddress address, byte[] their_hash, boolean use_crypto)
boolean
waitForCompletion(long max_millis)
-
-
-
Field Detail
-
random
private static java.util.Random random
-
tester
private NetStatusProtocolTester tester
-
test_initiator
private boolean test_initiator
-
listeners
private CopyOnWriteList listeners
-
my_hash
private byte[] my_hash
-
peer_id
private byte[] peer_id
-
explicit_bind
private java.net.InetAddress explicit_bind
-
pm_reg
private PeerManagerRegistration pm_reg
-
start_time
private long start_time
-
sessions
private java.util.List sessions
-
session_id_next
private int session_id_next
-
outbound_attempts
private int outbound_attempts
-
outbound_connects
private int outbound_connects
-
inbound_connects
private int inbound_connects
-
outbound_connections_complete
private boolean outbound_connections_complete
-
completion_sem
private AESemaphore completion_sem
-
destroyed
private boolean destroyed
-
-
Constructor Detail
-
NetStatusProtocolTesterBT
protected NetStatusProtocolTesterBT(NetStatusProtocolTester _tester, boolean _test_initiator)
-
-
Method Detail
-
setBindIP
public void setBindIP(java.net.InetAddress a)
-
start
protected void start()
-
getServerHash
protected byte[] getServerHash()
-
getStartTime
protected long getStartTime(long now)
-
testOutbound
protected void testOutbound(java.net.InetSocketAddress address, byte[] their_hash, boolean use_crypto)
-
destroy
public void destroy()
-
isDestroyed
protected boolean isDestroyed()
-
setOutboundConnectionsComplete
public void setOutboundConnectionsComplete()
-
checkCompletion
protected void checkCompletion()
-
waitForCompletion
public boolean waitForCompletion(long max_millis)
-
addListener
public void addListener(NetStatusProtocolTesterListener l)
-
removeListener
public void removeListener(NetStatusProtocolTesterListener l)
-
getOutboundConnects
public int getOutboundConnects()
-
getInboundConnects
public int getInboundConnects()
-
getStatus
public java.lang.String getStatus()
-
log
protected void log(java.lang.String str)
-
log
protected void log(java.lang.String str, boolean detailed)
-
logError
protected void logError(java.lang.String str)
-
logError
protected void logError(java.lang.String str, java.lang.Throwable e)
-
-