public class InputConnectionHandler extends AbstractConnectionHandler implements IInputConnectionHandler
AbstractConnectionHandler.SendInfo
Modifier and Type | Field and Description |
---|---|
protected int |
ackcnt
The number of received elements after which an ack is sent.
|
protected java.util.Map<java.lang.Integer,Tuple2<byte[],java.lang.Boolean>> |
data
The data (stored here only as long as it is out of order or incomplete).
|
protected java.util.TimerTask |
datatimer
The current timer.
|
protected int |
lastack
The last in order sequence number acknowledged.
|
protected int |
lastseqno
The last sequence number.
|
protected int |
maxackseqno
The highest yet (may be out of order) acknowledged sequence number (only used to trigger new acks every x messages).
|
protected int |
maxbuf
The maximum buffer size for out of order packets.
|
protected int |
maxseqno
The highest yet (may be out of order) received sequence number.
|
protected int |
maxstored
The maximum bytes of data that can be stored in connection (without being consumed).
|
protected int |
rseqno
The last in order received sequence number.
|
ACKCLOSE, ACKCLOSE_INPUT_INITIATOR, ACKCLOSE_OUTPUT_PARTICIPANT, ACKCLOSEREQ, ACKCLOSEREQ_INPUT_PARTICIPANT, ACKCLOSEREQ_OUTPUT_INITIATOR, ACKDATA, ACKDATA_INPUT_INITIATOR, ACKDATA_OUTPUT_PARTICIPANT, ACKINIT, ACKINIT_INPUT_PARTICIPANT, ACKINIT_OUTPUT_PARTICIPANT, acktimeout, ALIVE, ALIVE_INITIATOR, ALIVE_PARTICIPANT, alivetime, CLOSE, CLOSE_INPUT_PARTICIPANT, CLOSE_OUTPUT_INITIATOR, CLOSEREQ, CLOSEREQ_INPUT_INITIATOR, CLOSEREQ_OUTPUT_PARTICIPANT, component, con, DATA, DATA_INPUT_PARTICIPANT, DATA_OUTPUT_INITIATOR, EMPTY_BYTE_ARRAY, INIT, INIT_INPUT_INITIATOR, INIT_OUTPUT_INITIATOR, leasetime, maxresends, MESSAGE_TYPE_STREAM, MESSAGETYPES, nonfunc, timer, unacked
Constructor and Description |
---|
InputConnectionHandler(IInternalAccess component,
java.util.Map<java.lang.String,java.lang.Object> nonfunc)
Create a new input connection handler.
|
Modifier and Type | Method and Description |
---|---|
void |
addData(int seqnumber,
byte[] dat)
Called from message service.
|
void |
closeReceived(int seqno)
From initiator.
|
void |
createDataTimer(long acktimeout)
Create a new data ack timer.
|
IFuture<java.lang.Void> |
doClose()
Called from connection.
|
protected void |
forwardData(byte[] data)
Forward the data to the input connection.
|
InputConnection |
getInputConnection()
Get the input connection.
|
int |
getNextReceivedSequenceNumber()
Get the next received sequence number.
|
int |
getSequenceNumber()
Get the last received sequence number.
|
protected boolean |
isStop()
Test if stop is activated (too much data arrived).
|
void |
notifyDataRead()
Called by connection when user read some data
so that other side can continue to send.
|
protected void |
sendDataAck()
Send ack data.
|
protected void |
sendDataAck(int startseqno,
int endseqno,
boolean stop) |
ackReceived, close, createAckTimer, createTask, createTask, getComponent, getConnection, getConnectionId, getExecutionFeature, getLeasetime, getMessageFeature, getMessageType, getMessageType, getNonFunctionalProperties, initReceived, isClosed, isConnectionAlive, notifyInited, scheduleStep, sendAcknowledgedMessage, sendAlive, sendInit, sendTask, setAliveTime, setConnection, setNonFunctionalProperties, waitForRealDelay
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNonFunctionalProperties, notifyInited, sendInit, setConnection
protected int rseqno
protected int maxseqno
protected int maxackseqno
protected int maxbuf
protected int maxstored
protected java.util.Map<java.lang.Integer,Tuple2<byte[],java.lang.Boolean>> data
protected int lastack
protected int ackcnt
protected java.util.TimerTask datatimer
protected int lastseqno
public InputConnectionHandler(IInternalAccess component, java.util.Map<java.lang.String,java.lang.Object> nonfunc)
public void closeReceived(int seqno)
seqno
- The last data packet.public IFuture<java.lang.Void> doClose()
doClose
in interface IAbstractConnectionHandler
doClose
in class AbstractConnectionHandler
public void addData(int seqnumber, byte[] dat)
data
- The new data.protected void forwardData(byte[] data)
public int getSequenceNumber()
public int getNextReceivedSequenceNumber()
public void createDataTimer(long acktimeout)
protected void sendDataAck()
protected void sendDataAck(int startseqno, int endseqno, boolean stop)
public InputConnection getInputConnection()
protected boolean isStop()
public void notifyDataRead()
notifyDataRead
in interface IInputConnectionHandler