Send queue that manages messages.
More...
#include <TCPMsgBasedSendQueue.h>
Send queue that manages messages.
- See also
- TCPMsgBasedRcvQueue
inet::tcp::TCPMsgBasedSendQueue::TCPMsgBasedSendQueue |
( |
| ) |
|
Ctor.
uint32 end
Definition: TCPMsgBasedSendQueue.h:45
TCPSendQueue()
Ctor.
Definition: TCPSendQueue.h:91
uint32 begin
Definition: TCPMsgBasedSendQueue.h:44
inet::tcp::TCPMsgBasedSendQueue::~TCPMsgBasedSendQueue |
( |
| ) |
|
|
virtual |
Virtual dtor.
PayloadQueue payloadQueue
Definition: TCPMsgBasedSendQueue.h:42
TCPSegment * inet::tcp::TCPMsgBasedSendQueue::createSegmentWithBytes |
( |
uint32 |
fromSeq, |
|
|
ulong |
maxNumBytes |
|
) |
| |
|
overridevirtual |
Called when the TCP wants to send or retransmit data, it constructs a TCP segment which contains the data from the requested sequence number range.
The actually returned segment may contain less than maxNumBytes bytes if the subclass wants to reproduce the original segment boundaries when retransmitting.
Implements inet::tcp::TCPSendQueue.
80 TCPSegment *tcpseg =
new TCPSegment(
nullptr);
82 tcpseg->setSequenceNo(fromSeq);
83 tcpseg->setPayloadLength(numBytes);
91 uint32 toSeq = fromSeq + numBytes;
92 const char *payloadName =
nullptr;
96 payloadName = i->msg->getName();
98 tcpseg->addPayloadMessage(i->msg->dup(), i->endSequenceNo);
105 sprintf(msgname,
"tcpseg(l=%lu,%dmsg)", numBytes, tcpseg->getPayloadArraySize());
107 sprintf(msgname,
"%.10s(l=%lu,%dmsg)", payloadName, numBytes, tcpseg->getPayloadArraySize());
108 tcpseg->setName(msgname);
uint32 end
Definition: TCPMsgBasedSendQueue.h:45
PayloadQueue payloadQueue
Definition: TCPMsgBasedSendQueue.h:42
bool seqLE(uint32 a, uint32 b)
Definition: TCPSegment.h:33
uint32_t uint32
Definition: Compat.h:30
uint32 begin
Definition: TCPMsgBasedSendQueue.h:44
void inet::tcp::TCPMsgBasedSendQueue::discardUpTo |
( |
uint32 |
seqNum | ) |
|
|
overridevirtual |
Tells the queue that bytes up to (but NOT including) seqNum have been transmitted and ACKed, so they can be removed from the queue.
Implements inet::tcp::TCPSendQueue.
uint32 end
Definition: TCPMsgBasedSendQueue.h:45
PayloadQueue payloadQueue
Definition: TCPMsgBasedSendQueue.h:42
bool seqLE(uint32 a, uint32 b)
Definition: TCPSegment.h:33
uint32 begin
Definition: TCPMsgBasedSendQueue.h:44
void inet::tcp::TCPMsgBasedSendQueue::enqueueAppData |
( |
cPacket * |
msg | ) |
|
|
overridevirtual |
Called on SEND app command, it inserts in the queue the data the user wants to send.
Implementations of this abstract class will decide what this means: copying actual bytes, just increasing the "last byte queued" variable, or storing cMessage object(s). The msg object should not be referenced after this point (sendQueue may delete it.)
Implements inet::tcp::TCPSendQueue.
55 end += msg->getByteLength();
57 throw cRuntimeError(
"Send queue is full");
60 payload.endSequenceNo =
end;
uint32 end
Definition: TCPMsgBasedSendQueue.h:45
bool seqLess(uint32 a, uint32 b)
Definition: TCPSegment.h:32
PayloadQueue payloadQueue
Definition: TCPMsgBasedSendQueue.h:42
uint32 begin
Definition: TCPMsgBasedSendQueue.h:44
uint32 inet::tcp::TCPMsgBasedSendQueue::getBufferEndSeq |
( |
| ) |
|
|
overridevirtual |
Returns the sequence number of the last byte stored in the buffer plus one.
(The first byte of the next send operation would get this sequence number.)
Implements inet::tcp::TCPSendQueue.
uint32 end
Definition: TCPMsgBasedSendQueue.h:45
uint32 inet::tcp::TCPMsgBasedSendQueue::getBufferStartSeq |
( |
| ) |
|
|
overridevirtual |
Returns the sequence number of the first byte stored in the buffer.
Implements inet::tcp::TCPSendQueue.
uint32 begin
Definition: TCPMsgBasedSendQueue.h:44
std::string inet::tcp::TCPMsgBasedSendQueue::info |
( |
| ) |
const |
|
overridevirtual |
Returns a string with the region stored.
47 std::stringstream out;
uint32 end
Definition: TCPMsgBasedSendQueue.h:45
PayloadQueue payloadQueue
Definition: TCPMsgBasedSendQueue.h:42
uint32 begin
Definition: TCPMsgBasedSendQueue.h:44
void inet::tcp::TCPMsgBasedSendQueue::init |
( |
uint32 |
startSeq | ) |
|
|
overridevirtual |
Initialize the object.
The startSeq parameter tells what sequence number the first byte of app data should get. This is usually ISS + 1 because SYN consumes one byte in the sequence number space.
init() may be called more than once; every call flushes the existing contents of the queue.
Implements inet::tcp::TCPSendQueue.
uint32 end
Definition: TCPMsgBasedSendQueue.h:45
uint32 begin
Definition: TCPMsgBasedSendQueue.h:44
uint32 inet::tcp::TCPMsgBasedSendQueue::begin |
|
protected |
uint32 inet::tcp::TCPMsgBasedSendQueue::end |
|
protected |
The documentation for this class was generated from the following files: