TcpReadCommand¶
Namespace: inet
class TcpReadCommand
Control info that represents a READ request. Tcp only accepts READ requests from the user when the connection was opened with autoRead=false.
Tcp will respond to the reception of a READ request with data; either from previously received and buffered data, or data received from the network. Only one READ request may be outstanding, Tcp will not accept another READ until the previous one has been satisfied.
The maxByteCount field specifies the maximum number of bytes to be read. Note that Tcp will respond as soon as any data becomes available, so the response is often smaller than maxByteCount.
See also: TcpOpenCommand
Inheritance diagram¶
Extends¶
Name |
Type |
Description |
|---|---|---|
class |
Control info for TCP connections. This class is to be set as control info (see cMessage::setControlInfo()) on all messages exchanged between TCP and application, in both directions. Some commands and indications (TCP_C_OPEN_xxx, TCP_I_STATUS) use subclasses. |
Fields¶
Name |
Type |
Description |
|---|---|---|
userId |
int |
id than can be freely used by the app |
maxByteCount |
int32_t |
size limit for the data response |
Source code¶
//
// Control info that represents a READ request. ~Tcp only accepts READ requests
// from the user when the connection was opened with autoRead=false.
//
// ~Tcp will respond to the reception of a READ request with data; either
// from previously received and buffered data, or data received from the network.
// Only one READ request may be outstanding, ~Tcp will not accept another READ
// until the previous one has been satisfied.
//
// The maxByteCount field specifies the maximum number of bytes to be read.
// Note that ~Tcp will respond as soon as any data becomes available,
// so the response is often smaller than maxByteCount.
//
// @see ~TcpOpenCommand
//
class TcpReadCommand extends TcpCommand
{
int32_t maxByteCount; // size limit for the data response
}