9.15.1.8 +SOCKRD
This command is used to read data from a socket. Two AECs present notification of data received by the DCE:
The DTE is responsible for retrieving the datagram/stream data via the +SOCKRD
command.
For TCP sockets the DCE will indicate, via +SOCKRXT
, the number of bytes of data
which are currently available for reading via the +SOCKRD
command. The
DCE may issue multiple +SOCKRXT
AECs as data is received. When
requesting data via the +SOCKRD
command the DTE may receive less data
than request, the number of bytes provided by the DCE will be declared in the
+SOCKRD
response before the data is presented. The DTE may request
less data than that declared by the +SOCKRXT
AEC as being available,
the remaining data will be available for subsequent reading.
For UDP sockets the DCE will indicate, via +SOCKRXU
, the number of bytes of data
which were received in the oldest datagram received by the DCE. Only a single
+SOCKRXU
will be issued by the DCE even if subsequent UDP datagrams
are received. Reading data from the UDP socket via the +SOCKRD
command
will read and discard the current datagram, if less data is requested than was indicated
by the +SOCKRXU
AEC the remaining unread data in the datagram will be
discarded.
Security – Default Security for the command is: GGGG
Command |
Description |
Security |
---|---|---|
|
Socket read |
|
Parameter Name |
Type |
Description |
---|---|---|
|
Integer |
The socket ID. Valid range is 1-65535 |
|
Integer |
The format the DTE wishes to receive the data
|
|
Integer |
The number of bytes the DTE wishes to read |
Response |
Description |
---|---|
|
Socket read response |
Element Name |
Type |
Description |
---|---|---|
|
Integer |
The socket ID. Valid range is 1-65535 |
|
Integer |
Number of bytes |
|
Byte Array |
The data in the format requested |