Receive application data via socket, with error handling. See section C-13-46 for NetSock_RxData() for more information.
Files
net_app.h/net_app.c
...
This is the socket ID returned by NetApp_SockOpen()/
NetSock_Open()/socket()
when the socket was created or by NetApp_SockAccept()/NetSock_Accept()/accept()
when a connection was accepted.
pdatap_data_buf
Pointer to the application memory buffer to receive data.
...
In most cases, this flag would be set to NET_SOCK_FLAG_NONE/0
.
paddrp_addr_remote
Pointer to a socket address structure (see section 8-2 “Socket Interface” Network Sockets Concepts) to return the remote host address that sent the received data.
paddrp_addr_len
Pointer to the size of the socket address structure which must be passed the size of the socket address structure [e.g., sizeof(NET_SOCK_ADDR_IPIPv4)
]. Returns size of the accepted connection’s socket address structure, if no errors; returns 0
, otherwise.
...
Socket receive delay value, in milliseconds.
perr
p_err
Pointer to variable that will receive the error code from this function:
...
0
, otherwise.
Required Configuration
Available only if NET_APP_CFG_API_EN
is enabled (see section D-18-1) and either NET_CFG_TRANSPORT_LAYER_SEL
is configured for TCP (see section D-12-1) and/or NET_UDP_CFG_APP_API_SEL
is configured for sockets (see section D-13-1)None.
Notes / Warnings
Some socket arguments and/or operations are validated only if validation code is enabled (see section D-3-1section Argument Check Configuration).
If a non-zero number of retries is requested (retry_max
) and socket blocking is configured for non-blocking operation (see section D-15-3); then a non-zero timeout (timeout_ms
) and/or a non-zero time delay (time_dly_ms
) should also be requested. Otherwise, all retries will most likely fail immediately since no time will elapse to wait for and allow socket operations to successfully complete.