@CHIP-RTOS C Library V2.06 - TCP/IP API
recvfromto
Same as recvfrom, but returns the destination address int recvfromto ( int sd, char far *bufptr, int bufLen,
int flags, unsigned long timeout,
struct sockaddr far *fromPtr,
struct sockaddr far *toPtr,
int *error ); Parameters
sd
- Socket descriptor.
bufptr
- Pointer to input buffer where received
characters will be output.
bufLen
- Maximum characters to store in
buffer at bufptr
.
flags
- Wait option:
- MSG_BLOCKING
- Sleep until data comes in
- MSG_TIMEOUT
- The caller wakes up after timeout or
if bufLen
data bytes are received.
- MSG_DONTWAIT
- Return immediately after collecting
what ever data is ready
timeout
- Maximum milliseconds to wait if flags
is set
to MSG_TIMEOUT:
fromPtr
- Output parameter: Pointer to a
sockaddr_in
(IPv4) or
sockaddr_in6
(IPv6, SC123/SC143 only!
) data structure, which will be set
to indicate from where the received data originated. This pointer
can be set to NULL if this information is not desired.
toPtr
- Output parameter: Pointer to a user provided storage from type
sockaddr_in
(IPv4) or
sockaddr_in6
(IPv6, SC123/SC143 only!
) data structure, which will contain
(after sucessful return) the destination address.
error
- Output parameter: Failure
code, 0 on success.
Return Value
- -1: Failure, see error value reported
otherwise: Count of bytes received and placed in bufptr
(0 if time-out). Storage pointed by toPtr holds the destination address.
occurs due to a macro in the library header file.
See Also
RTOS API
- This library function invokes a RTOS software interrupt.
Refer to this RTOS API function's
documentation
for more details.
Supported since or modified in @CHIP-RTOS version-
SC12 | SC13 | SC11 | SC1x3 |
-
n/a | n/a | n/a | V1.07 |
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document
|