|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.transport.TransportImpl
net.i2p.router.transport.ntcp.NTCPTransport
public class NTCPTransport
Field Summary | |
---|---|
static int |
ESTABLISH_TIMEOUT
how long from initial connection attempt (accept() or connect()) until the con must be established to avoid premature close()ing |
static java.lang.String |
PROP_BIND_INTERFACE
this is rarely if ever used, default is to bind to wildcard address |
static java.lang.String |
STYLE
|
Fields inherited from class net.i2p.router.transport.TransportImpl |
---|
_context, ADJUST_COST |
Fields inherited from interface net.i2p.router.transport.Transport |
---|
SOURCE_CONFIG, SOURCE_INTERFACE, SOURCE_UPNP |
Constructor Summary | |
---|---|
NTCPTransport(RouterContext ctx)
|
Method Summary | |
---|---|
void |
afterSend(OutNetMessage msg,
boolean sendSuccessful,
boolean allowRequeue,
long msToSend)
The transport is done sending this message. |
boolean |
allowConnection()
|
TransportBid |
bid(RouterInfo toAddress,
long dataSize)
|
int |
countActivePeers()
How many peers can we talk to right now? |
int |
countActiveSendPeers()
How many peers are we actively sending messages to (this minute) |
(package private) void |
establishing(NTCPConnection con)
add us to the establishment timeout process |
(package private) void |
expireTimedOut()
called in the EventPumper no more than once a second or so, closing any unconnected/unestablished connections |
void |
forwardPortStatus(int port,
boolean success,
java.lang.String reason)
If we didn't used to be forwarded, and we have an address, and we are configured to use UPnP, update our RouterAddress Don't do anything now. |
java.util.Vector<java.lang.Long> |
getClockSkews()
Return our peer clock skews on this transport. |
(package private) EventPumper |
getPumper()
|
short |
getReachabilityStatus()
Maybe we should trust UPnP here and report OK if it opened the port, but for now we don't. |
(package private) Reader |
getReader()
|
int |
getRequestedPort()
What port would the transport like to have forwarded by UPnP. |
java.lang.String |
getStyle()
|
(package private) Writer |
getWriter()
|
(package private) void |
inboundEstablished(NTCPConnection con)
|
boolean |
isAlive()
|
boolean |
isBacklogged(Hash dest)
|
boolean |
isEstablished(Hash dest)
|
protected void |
outboundMessageReady()
This message is called whenever a new message is added to the send pool, and it should not block |
(package private) void |
removeCon(NTCPConnection con)
|
void |
renderStatusHTML(java.io.Writer out,
int sortFlags)
|
void |
renderStatusHTML(java.io.Writer out,
java.lang.String urlBase,
int sortFlags)
|
RouterAddress |
restartListening(RouterAddress addr)
Only called by CSFI. |
(package private) void |
sendComplete(OutNetMessage msg)
queue up afterSend call, which can take some time w/ jobs, etc |
(package private) void |
setLastBadSkew(long skew)
|
RouterAddress |
startListening()
Called by TransportManager. |
void |
stopListening()
This doesn't (completely) block, caller should check isAlive() before calling startListening() or restartListening() |
Methods inherited from class net.i2p.router.transport.TransportImpl |
---|
afterSend, afterSend, afterSend, countPeers, externalAddressReceived, getContext, getCurrentAddress, getIP, getMaxConnections, getMostRecentErrorMessages, getNextMessage, haveCapacity, haveCapacity, isPubliclyRoutable, isUnreachable, markReachable, markUnreachable, markWasUnreachable, messageReceived, recheckReachability, renderStatusHTML, replaceAddress, send, setIP, setListener, updateAddress, wasUnreachable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROP_BIND_INTERFACE
public static final int ESTABLISH_TIMEOUT
public static final java.lang.String STYLE
Constructor Detail |
---|
public NTCPTransport(RouterContext ctx)
Method Detail |
---|
void inboundEstablished(NTCPConnection con)
protected void outboundMessageReady()
TransportImpl
outboundMessageReady
in class TransportImpl
public void afterSend(OutNetMessage msg, boolean sendSuccessful, boolean allowRequeue, long msToSend)
TransportImpl
afterSend
in class TransportImpl
msg
- message in questionsendSuccessful
- true if the peer received itallowRequeue
- true if we should try other transports if availablemsToSend
- how long it took to transfer the data to the peerpublic TransportBid bid(RouterInfo toAddress, long dataSize)
public boolean allowConnection()
void sendComplete(OutNetMessage msg)
public boolean isEstablished(Hash dest)
isEstablished
in interface Transport
isEstablished
in class TransportImpl
public boolean isBacklogged(Hash dest)
isBacklogged
in interface Transport
isBacklogged
in class TransportImpl
void removeCon(NTCPConnection con)
public int countActivePeers()
countActivePeers
in interface Transport
countActivePeers
in class TransportImpl
public int countActiveSendPeers()
countActiveSendPeers
in interface Transport
countActiveSendPeers
in class TransportImpl
void setLastBadSkew(long skew)
skew
- in secondspublic java.util.Vector<java.lang.Long> getClockSkews()
getClockSkews
in interface Transport
getClockSkews
in class TransportImpl
public RouterAddress startListening()
public RouterAddress restartListening(RouterAddress addr)
public boolean isAlive()
Reader getReader()
Writer getWriter()
public java.lang.String getStyle()
EventPumper getPumper()
void establishing(NTCPConnection con)
void expireTimedOut()
public void forwardPortStatus(int port, boolean success, java.lang.String reason)
forwardPortStatus
in interface Transport
forwardPortStatus
in class TransportImpl
public int getRequestedPort()
TransportImpl
getRequestedPort
in interface Transport
getRequestedPort
in class TransportImpl
public short getReachabilityStatus()
getReachabilityStatus
in interface Transport
getReachabilityStatus
in class TransportImpl
public void stopListening()
public void renderStatusHTML(java.io.Writer out, int sortFlags) throws java.io.IOException
java.io.IOException
public void renderStatusHTML(java.io.Writer out, java.lang.String urlBase, int sortFlags) throws java.io.IOException
renderStatusHTML
in interface Transport
renderStatusHTML
in class TransportImpl
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |