|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.transport.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? |
RouterContext |
getContext()
|
java.util.Set |
getCurrentAddresses()
What addresses are we currently listening to? |
java.util.List |
getMostRecentErrorMessages()
|
OutNetMessage |
getNextMessage()
Nonblocking call to pull the next outbound message off the queue. |
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 |
renderStatusHTML(java.io.Writer out)
Make this stuff pretty (only used in the old console) |
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 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 java.util.Set getCurrentAddresses()
getCurrentAddresses
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
renderStatusHTML
in interface Transport
java.io.IOException
public RouterContext getContext()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |