forked from I2P_Developers/i2p.i2p
* TransportBid: Remove unused stuff
This commit is contained in:
@@ -17,25 +17,24 @@ import net.i2p.data.RouterInfo;
|
|||||||
*/
|
*/
|
||||||
public class TransportBid {
|
public class TransportBid {
|
||||||
private int _latencyMs;
|
private int _latencyMs;
|
||||||
private int _bandwidthBytes;
|
//private int _bandwidthBytes;
|
||||||
private int _msgSize;
|
//private int _msgSize;
|
||||||
private RouterInfo _router;
|
//private RouterInfo _router;
|
||||||
private long _bidExpiration;
|
//private long _bidExpiration;
|
||||||
private Transport _transport;
|
private Transport _transport;
|
||||||
|
|
||||||
public static final int TRANSIENT_FAIL = 999999;
|
public static final int TRANSIENT_FAIL = 999999;
|
||||||
|
|
||||||
public TransportBid() {
|
public TransportBid() {
|
||||||
setLatencyMs(-1);
|
_latencyMs = -1;
|
||||||
setBandwidthBytes(-1);
|
//_bandwidthBytes = -1;
|
||||||
setMessageSize(-1);
|
//_msgSize = -1;
|
||||||
setRouter(null);
|
|
||||||
setExpiration(0);
|
|
||||||
setTransport(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How long this transport thinks it would take to send the message
|
* How long this transport thinks it would take to send the message
|
||||||
|
* This is the actual bid value, lower is better, and it doesn't really have
|
||||||
|
* anything to do with latency.
|
||||||
*/
|
*/
|
||||||
public int getLatencyMs() { return _latencyMs; }
|
public int getLatencyMs() { return _latencyMs; }
|
||||||
public void setLatencyMs(int milliseconds) { _latencyMs = milliseconds; }
|
public void setLatencyMs(int milliseconds) { _latencyMs = milliseconds; }
|
||||||
@@ -45,28 +44,28 @@ public class TransportBid {
|
|||||||
* message successfully
|
* message successfully
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public int getBandwidthBytes() { return _bandwidthBytes; }
|
//public int getBandwidthBytes() { return _bandwidthBytes; }
|
||||||
public void setBandwidthBytes(int numBytes) { _bandwidthBytes = numBytes; }
|
//public void setBandwidthBytes(int numBytes) { _bandwidthBytes = numBytes; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How large the message in question is, in bytes
|
* How large the message in question is, in bytes
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public int getMessageSize() { return _msgSize; }
|
//public int getMessageSize() { return _msgSize; }
|
||||||
public void setMessageSize(int numBytes) { _msgSize = numBytes; }
|
//public void setMessageSize(int numBytes) { _msgSize = numBytes; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Router to which the message is to be sent
|
* Router to which the message is to be sent
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public RouterInfo getRouter() { return _router; }
|
//public RouterInfo getRouter() { return _router; }
|
||||||
public void setRouter(RouterInfo router) { _router = router; }
|
//public void setRouter(RouterInfo router) { _router = router; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies how long this bid is "good for"
|
* Specifies how long this bid is "good for"
|
||||||
*/
|
*/
|
||||||
public long getExpiration() { return _bidExpiration; }
|
//public long getExpiration() { return _bidExpiration; }
|
||||||
public void setExpiration(long expirationDate) { _bidExpiration = expirationDate; }
|
//public void setExpiration(long expirationDate) { _bidExpiration = expirationDate; }
|
||||||
//public void setExpiration(long expirationDate) { setExpiration(new Date(expirationDate)); }
|
//public void setExpiration(long expirationDate) { setExpiration(new Date(expirationDate)); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -403,7 +403,6 @@ public class TransportManager implements TransportEventListener {
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("static-access")
|
|
||||||
public TransportBid getNextBid(OutNetMessage msg) {
|
public TransportBid getNextBid(OutNetMessage msg) {
|
||||||
int unreachableTransports = 0;
|
int unreachableTransports = 0;
|
||||||
Hash peer = msg.getTarget().getIdentity().calculateHash();
|
Hash peer = msg.getTarget().getIdentity().calculateHash();
|
||||||
@@ -427,8 +426,7 @@ public class TransportManager implements TransportEventListener {
|
|||||||
// to us via TCP, send via TCP)
|
// to us via TCP, send via TCP)
|
||||||
TransportBid bid = t.bid(msg.getTarget(), msg.getMessageSize());
|
TransportBid bid = t.bid(msg.getTarget(), msg.getMessageSize());
|
||||||
if (bid != null) {
|
if (bid != null) {
|
||||||
/* FIXME Accessing static field "TRANSIENT_FAIL" FIXME */
|
if (bid.getLatencyMs() == TransportBid.TRANSIENT_FAIL)
|
||||||
if (bid.getLatencyMs() == bid.TRANSIENT_FAIL)
|
|
||||||
// this keeps GetBids() from shitlisting for "no common transports"
|
// this keeps GetBids() from shitlisting for "no common transports"
|
||||||
msg.transportFailed(t.getStyle());
|
msg.transportFailed(t.getStyle());
|
||||||
else if ( (rv == null) || (rv.getLatencyMs() > bid.getLatencyMs()) )
|
else if ( (rv == null) || (rv.getLatencyMs() > bid.getLatencyMs()) )
|
||||||
|
Reference in New Issue
Block a user