|
||||||||||
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.tcp.TCPTransport
public class TCPTransport
TCP Transport implementation, coordinating the connections between peers and the transmission of messages across those connections.
Field Summary | |
---|---|
static java.lang.String |
BIND_ALL_INTERFACES
Should the TCP listener bind to all interfaces? |
static int |
DEFAULT_ESTABLISHERS
|
static int |
DEFAULT_LISTEN_PORT
blah, people shouldnt use defaults... |
static java.lang.String |
LISTEN_ADDRESS
What host/ip should we be addressed as? |
static java.lang.String |
LISTEN_ALLOW_LOCAL
Should we allow the transport to listen on a non routable address? |
static java.lang.String |
LISTEN_PORT
What port number should we listen to? |
static int |
MAX_ERR_MESSAGES
Keep track of the last 10 error messages wrt establishing a connection |
static java.lang.String |
PROP_ESTABLISHERS
|
static java.lang.String |
STYLE
What is this transport's identifier? |
static int[] |
SUPPORTED_PROTOCOLS
Ordered list of supported I2NP protocols |
Fields inherited from class net.i2p.router.transport.TransportImpl |
---|
_context |
Constructor Summary | |
---|---|
TCPTransport(RouterContext context)
Creates a new instance of TCPTransport |
Method Summary | |
---|---|
(package private) void |
addConnectionErrorMessage(java.lang.String msg)
Add the given message to the list of most recent connection establishment error messages. |
void |
afterSend(OutNetMessage msg,
boolean sendSuccessful,
boolean allowRequeue,
long msToSend)
The transport is done sending this message. |
(package private) boolean |
allowAddress(TCPAddress address)
Is the given address a valid one that we could listen to or contact? |
TransportBid |
bid(RouterInfo toAddress,
long dataSize)
|
(package private) void |
connectionClosed(TCPConnection con)
|
(package private) void |
connectionEstablished(TCPConnection con)
The connection specified has been fully built |
int |
countActiveAgreeingPeers(java.lang.String address)
How many peers that we are connected to think we are reachable at the given address? |
int |
countActivePeers()
How many peers can we talk to right now? |
(package private) void |
establishmentComplete(RouterInfo info)
Called after an establisher finished (or failed) connecting to the peer |
java.util.List |
getMostRecentErrorMessages()
|
(package private) java.lang.String |
getMyHost()
|
(package private) RouterInfo |
getNextPeer()
Blocking call to retrieve the next peer that we want to establish a connection with. |
(package private) int |
getPort()
What port should we be reachable on? |
java.lang.String |
getStyle()
|
(package private) ConnectionTagManager |
getTagManager()
|
(package private) void |
ourAddressReceived(java.lang.String address)
Blocking call from when a remote peer tells us what they think our IP address is. |
protected void |
outboundMessageReady()
Called whenever a new message is ready to be sent. |
void |
renderStatusHTML(java.io.Writer out)
Make this stuff pretty (only used in the old console) |
(package private) boolean |
shouldListenToAllInterfaces()
Should we listen to all interfaces, or just the one specified in our TCPAddress? |
RouterAddress |
startListening()
|
void |
stopListening()
|
Methods inherited from class net.i2p.router.transport.TransportImpl |
---|
afterSend, afterSend, afterSend, countActiveSendPeers, getClockSkews, getContext, getCurrentAddress, getNextMessage, getReachabilityStatus, isBacklogged, isPubliclyRoutable, isUnreachable, markReachable, markUnreachable, messageReceived, recheckReachability, renderStatusHTML, replaceAddress, send, setListener |
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 STYLE
public static final java.lang.String BIND_ALL_INTERFACES
public static final java.lang.String LISTEN_ADDRESS
public static final java.lang.String LISTEN_PORT
public static final java.lang.String LISTEN_ALLOW_LOCAL
public static final int MAX_ERR_MESSAGES
public static final java.lang.String PROP_ESTABLISHERS
public static final int DEFAULT_ESTABLISHERS
public static final int[] SUPPORTED_PROTOCOLS
public static final int DEFAULT_LISTEN_PORT
Constructor Detail |
---|
public TCPTransport(RouterContext context)
Method Detail |
---|
public TransportBid bid(RouterInfo toAddress, long dataSize)
protected void outboundMessageReady()
outboundMessageReady
in class TransportImpl
void connectionEstablished(TCPConnection con)
void connectionClosed(TCPConnection con)
void ourAddressReceived(java.lang.String address)
address
- address that the remote host said was ourspublic RouterAddress startListening()
public void stopListening()
boolean shouldListenToAllInterfaces()
void addConnectionErrorMessage(java.lang.String msg)
java.lang.String getMyHost()
public java.lang.String getStyle()
ConnectionTagManager getTagManager()
boolean allowAddress(TCPAddress address)
int getPort()
public java.util.List getMostRecentErrorMessages()
getMostRecentErrorMessages
in interface Transport
getMostRecentErrorMessages
in class TransportImpl
public int countActivePeers()
countActivePeers
in interface Transport
countActivePeers
in class TransportImpl
public int countActiveAgreeingPeers(java.lang.String address)
public void afterSend(OutNetMessage msg, boolean sendSuccessful, boolean allowRequeue, long msToSend)
afterSend
in class TransportImpl
msg
- message in questionsendSuccessful
- true if the peer received itmsToSend
- how long it took to transfer the data to the peerallowRequeue
- true if we should try other transports if availableRouterInfo getNextPeer()
void establishmentComplete(RouterInfo info)
public void renderStatusHTML(java.io.Writer out) throws java.io.IOException
renderStatusHTML
in class TransportImpl
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |