|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.transport.TransportImpl
public abstract class TransportImpl
Defines a way to send a message to another peer and start listening for messages
Field Summary | |
---|---|
protected RouterContext |
_context
|
Constructor Summary | |
---|---|
TransportImpl(RouterContext context)
Initialize the new transport |
Method Summary | |
---|---|
protected void |
afterSend(OutNetMessage msg,
boolean sendSuccessful)
The transport is done sending this message |
protected void |
afterSend(OutNetMessage msg,
boolean sendSuccessful,
boolean allowRequeue)
The transport is done sending this message |
protected void |
afterSend(OutNetMessage msg,
boolean sendSuccessful,
boolean allowRequeue,
long msToSend)
The transport is done sending this message. |
protected void |
afterSend(OutNetMessage msg,
boolean sendSuccessful,
long msToSend)
The transport is done sending this message |
int |
countActivePeers()
How many peers can we talk to right now? |
int |
countActiveSendPeers()
How many peers are we actively sending messages to (this minute) |
java.util.Vector |
getClockSkews()
Return our peer clock skews on a transport. |
RouterContext |
getContext()
|
RouterAddress |
getCurrentAddress()
What addresses are we currently listening to? |
java.util.List |
getMostRecentErrorMessages()
|
OutNetMessage |
getNextMessage()
Nonblocking call to pull the next outbound message off the queue. |
short |
getReachabilityStatus()
|
boolean |
isBacklogged(Hash dest)
|
static boolean |
isPubliclyRoutable(byte[] addr)
|
boolean |
isUnreachable(Hash peer)
|
void |
markReachable(Hash peer)
called when we establish a peer connection (outbound or inbound) |
void |
markUnreachable(Hash peer)
called when we can't reach a peer |
void |
messageReceived(I2NPMessage inMsg,
RouterIdentity remoteIdent,
Hash remoteIdentHash,
long msToReceive,
int bytesReceived)
Message received from the I2NPMessageReader - send it to the listener |
protected abstract void |
outboundMessageReady()
This message is called whenever a new message is added to the send pool, and it should not block |
void |
recheckReachability()
|
void |
renderStatusHTML(java.io.Writer out)
Make this stuff pretty (only used in the old console) |
void |
renderStatusHTML(java.io.Writer out,
java.lang.String urlBase,
int sortFlags)
|
protected void |
replaceAddress(RouterAddress address)
Replace any existing addresses for the current transport with the given one. |
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). |
void |
setListener(TransportEventListener listener)
Who to notify on message availability |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.i2p.router.transport.Transport |
---|
bid, getStyle, startListening, stopListening |
Field Detail |
---|
protected RouterContext _context
Constructor Detail |
---|
public TransportImpl(RouterContext context)
Method Detail |
---|
public int countActivePeers()
countActivePeers
in interface Transport
public int countActiveSendPeers()
countActiveSendPeers
in interface Transport
public java.util.Vector getClockSkews()
getClockSkews
in interface Transport
public java.util.List getMostRecentErrorMessages()
getMostRecentErrorMessages
in interface Transport
public OutNetMessage getNextMessage()
protected void afterSend(OutNetMessage msg, boolean sendSuccessful)
msg
- message in questionsendSuccessful
- true if the peer received itprotected void afterSend(OutNetMessage msg, boolean sendSuccessful, boolean allowRequeue)
msg
- message in questionsendSuccessful
- true if the peer received itallowRequeue
- true if we should try other transports if availableprotected void afterSend(OutNetMessage msg, boolean sendSuccessful, long msToSend)
msg
- message in questionsendSuccessful
- true if the peer received itmsToSend
- how long it took to transfer the data to the peerprotected void afterSend(OutNetMessage msg, boolean sendSuccessful, boolean allowRequeue, long msToSend)
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 availablepublic void send(OutNetMessage msg)
send
in interface Transport
protected abstract void outboundMessageReady()
public void messageReceived(I2NPMessage inMsg, RouterIdentity remoteIdent, Hash remoteIdentHash, long msToReceive, int bytesReceived)
public RouterAddress getCurrentAddress()
getCurrentAddress
in interface Transport
protected void replaceAddress(RouterAddress address)
public void setListener(TransportEventListener listener)
setListener
in interface Transport
public void renderStatusHTML(java.io.Writer out) 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
java.io.IOException
public RouterContext getContext()
public short getReachabilityStatus()
getReachabilityStatus
in interface Transport
public void recheckReachability()
recheckReachability
in interface Transport
public boolean isBacklogged(Hash dest)
isBacklogged
in interface Transport
public boolean isUnreachable(Hash peer)
isUnreachable
in interface Transport
public void markUnreachable(Hash peer)
public void markReachable(Hash peer)
public static boolean isPubliclyRoutable(byte[] addr)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |