Sock.Getdata Method

Top  Previous  Next

 

Function:

For the selected socket (selection is made through sock.num) returns the string that contains the data extracted from the RX buffer.

Syntax:

ser.getdata(maxinplen as word) as string

Returns:

String containing data extracted from the RX buffer

See Also:

sock.peekdata

 


Part

Description

maxinplen

Maximum amount of data to return (word).

Details

Extracted data is permanently deleted from the buffer. Length of extracted data is limited by one of the three factors (whichever is smaller): amount of data in the RX buffer itself, capacity of the "receiving" string variable, and the limit set by the maxinplen argument.

Additionally, if this socket uses UDP transport protocol (sock.protocol= 1-PL_SOCK_PROTOCOL_TCP) the length of data that will be extracted is limited to the UDP datagram being processed. Additional conditions apply to UDP datagram processing; see on_sock_data_arrival event and sock.nextpacket method.