|
||||||||||
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.udp.UDPTransport
public class UDPTransport
Field Summary | |
---|---|
static java.lang.String |
PROP_ALLOW_DIRECT
do we allow direct SSU connections, sans introducers? |
static java.lang.String |
PROP_BIND_INTERFACE
|
static java.lang.String |
PROP_EXTERNAL_HOST
define this to explicitly set an external IP address |
static java.lang.String |
PROP_EXTERNAL_PORT
define this to explicitly set an external port |
static java.lang.String |
PROP_FIXED_PORT
|
static java.lang.String |
PROP_FORCE_INTRODUCERS
do we require introducers, regardless of our status? |
static java.lang.String |
PROP_INTERNAL_PORT
|
static java.lang.String |
PROP_PREFER_UDP
If i2np.udp.preferred is set to "always", the UDP bids will always be under the bid from the TCP transport - even if a TCP connection already exists. |
static int |
PUBLIC_RELAY_COUNT
how many relays offered to us will we use at a time? |
static java.lang.String |
STYLE
|
Constructor Summary | |
---|---|
UDPTransport(RouterContext ctx)
|
Method Summary | |
---|---|
java.util.List |
_getActivePeers()
internal, do not use** return the peers (Hash) of active peers. |
static UDPTransport |
_instance()
internal, do not use** |
(package private) boolean |
addRemotePeerState(PeerState peer)
add the peer info, returning true if it went in properly, false if it was rejected (causes include peer ident already connected, or no remote host info known |
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 |
dropPeer(Hash peer,
boolean shouldShitlist,
java.lang.String why)
|
(package private) void |
externalAddressReceived(Hash from,
byte[] ourIP,
int ourPort)
Someone we tried to contact gave us what they think our IP address is. |
void |
failed(OutboundMessageState msg)
|
(package private) void |
failed(OutboundMessageState msg,
boolean allowPeerFailure)
|
void |
failed(OutNetMessage msg,
java.lang.String reason)
|
java.util.Vector |
getClockSkews()
Return our peer clock skews on this transport. |
RouterAddress |
getCurrentAddress()
What addresses are we currently listening to? |
int |
getExternalPort()
|
SessionKey |
getIntroKey()
Introduction key that people should use to contact us |
java.net.InetAddress |
getLocalAddress()
|
int |
getLocalPort()
|
(package private) java.lang.String |
getPacketHandlerStatus()
|
PeerState |
getPeerState(Hash remotePeer)
get the state for the peer with the given ident, or null if no state exists |
PeerState |
getPeerState(long relayTag)
get the state for the peer being introduced, or null if we aren't offering to introduce anyone with that tag. |
PeerState |
getPeerState(RemoteHostId hostInfo)
get the state for the peer at the given remote host/port, or null if no state exists |
short |
getReachabilityStatus()
|
java.lang.String |
getStyle()
|
(package private) void |
inboundConnectionReceived()
|
boolean |
introducersRequired()
|
boolean |
isInDropList(RemoteHostId peer)
|
boolean |
isValid(byte[] addr)
|
static void |
main(java.lang.String[] args)
|
void |
messageReceived(I2NPMessage inMsg,
RouterIdentity remoteIdent,
Hash remoteIdentHash,
long msToReceive,
int bytesReceived)
Message received from the I2NPMessageReader - send it to the listener |
protected void |
outboundMessageReady()
This message is called whenever a new message is added to the send pool, and it should not block |
PeerState |
pickTestPeer(RemoteHostId dontInclude)
|
(package private) void |
rebuildExternalAddress()
|
(package private) void |
rebuildExternalAddress(boolean allowRebuildRouterInfo)
|
void |
recheckReachability()
|
void |
renderStatusHTML(java.io.Writer out,
int sortFlags)
|
void |
renderStatusHTML(java.io.Writer out,
java.lang.String urlBase,
int sortFlags)
|
protected void |
replaceAddress(RouterAddress address,
RouterAddress oldAddress)
|
(package private) void |
send(I2NPMessage msg,
PeerState peer)
|
void |
send(OutNetMessage msg)
Asynchronously send the message as requested in the message and, if the send is successful, queue up any msg.getOnSendJob job, and register it with the OutboundMessageRegistry (if it has a reply selector). |
(package private) int |
send(UDPPacket packet)
|
(package private) void |
setExternalListenHost(byte[] addr)
|
(package private) void |
setExternalListenHost(java.net.InetAddress addr)
|
(package private) void |
setExternalListenPort(int port)
|
(package private) void |
setReachabilityStatus(short status)
|
void |
shutdown()
|
RouterAddress |
startListening()
|
void |
startup()
|
void |
stopListening()
|
void |
succeeded(OutboundMessageState msg)
|
Methods inherited from class net.i2p.router.transport.TransportImpl |
---|
afterSend, afterSend, afterSend, afterSend, getContext, getMostRecentErrorMessages, getNextMessage, isBacklogged, isPubliclyRoutable, isUnreachable, markReachable, markUnreachable, renderStatusHTML, replaceAddress, 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 PROP_INTERNAL_PORT
public static final java.lang.String PROP_EXTERNAL_HOST
public static final java.lang.String PROP_EXTERNAL_PORT
public static final java.lang.String PROP_PREFER_UDP
public static final java.lang.String PROP_FIXED_PORT
public static final java.lang.String PROP_FORCE_INTRODUCERS
public static final java.lang.String PROP_ALLOW_DIRECT
public static final java.lang.String PROP_BIND_INTERFACE
public static final int PUBLIC_RELAY_COUNT
Constructor Detail |
---|
public UDPTransport(RouterContext ctx)
Method Detail |
---|
public void startup()
public void shutdown()
public SessionKey getIntroKey()
public int getLocalPort()
public java.net.InetAddress getLocalAddress()
public int getExternalPort()
void inboundConnectionReceived()
void externalAddressReceived(Hash from, byte[] ourIP, int ourPort)
public final boolean isValid(byte[] addr)
public PeerState getPeerState(RemoteHostId hostInfo)
public PeerState getPeerState(Hash remotePeer)
public PeerState getPeerState(long relayTag)
boolean addRemotePeerState(PeerState peer)
public RouterAddress getCurrentAddress()
TransportImpl
getCurrentAddress
in interface Transport
getCurrentAddress
in class TransportImpl
public void messageReceived(I2NPMessage inMsg, RouterIdentity remoteIdent, Hash remoteIdentHash, long msToReceive, int bytesReceived)
TransportImpl
messageReceived
in class TransportImpl
public boolean isInDropList(RemoteHostId peer)
void dropPeer(Hash peer, boolean shouldShitlist, java.lang.String why)
int send(UDPPacket packet)
public TransportBid bid(RouterInfo toAddress, long dataSize)
bid
in interface Transport
public java.lang.String getStyle()
getStyle
in interface Transport
public void send(OutNetMessage msg)
TransportImpl
send
in interface Transport
send
in class TransportImpl
void send(I2NPMessage msg, PeerState peer)
protected void outboundMessageReady()
TransportImpl
outboundMessageReady
in class TransportImpl
public RouterAddress startListening()
startListening
in interface Transport
public void stopListening()
stopListening
in interface Transport
void setExternalListenPort(int port)
void setExternalListenHost(java.net.InetAddress addr)
void setExternalListenHost(byte[] addr) throws java.net.UnknownHostException
java.net.UnknownHostException
void rebuildExternalAddress()
void rebuildExternalAddress(boolean allowRebuildRouterInfo)
protected void replaceAddress(RouterAddress address, RouterAddress oldAddress)
public boolean introducersRequired()
java.lang.String getPacketHandlerStatus()
public void failed(OutboundMessageState msg)
void failed(OutboundMessageState msg, boolean allowPeerFailure)
public void failed(OutNetMessage msg, java.lang.String reason)
failed
in interface TimedWeightedPriorityMessageQueue.FailedListener
public void succeeded(OutboundMessageState msg)
public int countActivePeers()
TransportImpl
countActivePeers
in interface Transport
countActivePeers
in class TransportImpl
public int countActiveSendPeers()
TransportImpl
countActiveSendPeers
in interface Transport
countActiveSendPeers
in class TransportImpl
public java.util.Vector getClockSkews()
getClockSkews
in interface Transport
getClockSkews
in class TransportImpl
public static final UDPTransport _instance()
public java.util.List _getActivePeers()
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
void setReachabilityStatus(short status)
public short getReachabilityStatus()
getReachabilityStatus
in interface Transport
getReachabilityStatus
in class TransportImpl
public void recheckReachability()
recheckReachability
in interface Transport
recheckReachability
in class TransportImpl
public PeerState pickTestPeer(RemoteHostId dontInclude)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |