|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.client.streaming.ConnectionDataReceiver
class ConnectionDataReceiver
Receive data from the MessageOutputStream, build a packet, and send it through a connection. The write calls on this do NOT block, but they also do not necessary imply immediate delivery, or even the generation of a new packet. This class is the only one that builds useful outbound Packet objects.
Constructor Summary | |
---|---|
ConnectionDataReceiver(I2PAppContext ctx,
Connection con)
|
Method Summary | |
---|---|
(package private) void |
destroy()
|
PacketLocal |
send(byte[] buf,
int off,
int size)
Send some data through the connection, attaching any appropriate flags onto the packet. |
PacketLocal |
send(byte[] buf,
int off,
int size,
boolean forceIncrement)
|
MessageOutputStream.WriteStatus |
writeData(byte[] buf,
int off,
int size)
Send some data through the connection, or if there is no new data, this may generate a packet with a plain ACK/NACK or CLOSE, or nothing whatsoever if there's nothing new to send. |
boolean |
writeInProcess()
This tells the flusher in MessageOutputStream whether to flush. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionDataReceiver(I2PAppContext ctx, Connection con)
Method Detail |
---|
public boolean writeInProcess()
writeInProcess
in interface MessageOutputStream.DataReceiver
public MessageOutputStream.WriteStatus writeData(byte[] buf, int off, int size)
writeData
in interface MessageOutputStream.DataReceiver
buf
- data to be sent - may be nulloff
- offset into the buffer to start writing fromsize
- how many bytes of the buffer to write (may be 0)
public PacketLocal send(byte[] buf, int off, int size)
buf
- data to be sent - may be nulloff
- offset into the buffer to start writing fromsize
- how many bytes of the buffer to write (may be 0)
public PacketLocal send(byte[] buf, int off, int size, boolean forceIncrement)
buf
- data to be sent - may be nulloff
- offset into the buffer to start writing fromsize
- how many bytes of the buffer to write (may be 0)forceIncrement
- even if the buffer is empty, increment the packetId
so we get an ACK back
void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |