#include <rtl.h>
int ioctlsocket (
int sock, /* Socket descriptor */
long cmd, /* A command to perform */
unsigned long *argp); /* Pointer to a parameter */
Description
The ioctlsocket function controls the I/O mode of a socket.
It can be used on any socket in any state to set or retrieve some
operating parameters of the socket.
The argument sock specifies a socket descriptor returned
from a previous call to socket.
The argument cmd specifies a command to perform on a
socket. The following commands are supported:
Comand
Description
FIONBIO
Sets the blocking or non-blocking socket I/O mode.
FIO_DELAY_ACK
Sets the delay-ack or normal mode for the stream
socket.
FIO_KEEP_ALIVE
Sets the keep-alive or timeout mode for the stream
socket.
FIO_FLOW_CTRL
Sets the receive flow-control or normal mode for the stream
socket.
The argument argp specifies a pointer to the command's
parameter.
For the command FIONBIO the argument values are:
*argp value
I/O mode
0
Blocking mode
nonzero
Non-blocking mode
For the command FIO_DELAY_ACK the argument values are:
*argp value
Socket mode
Description
0
Normal mode
Waits for an ACK after each sending packet.
nonzero
Delay-ack mode
Eliminates the delayed acknowledge impact and improves the
performance for applications sending large amount of data.
For the command FIO_KEEP_ALIVE the argument values are:
*argp value
Socket mode
Description
0
Timeout mode
After a timeout a stream socket is disconnected.
nonzero
Keep-alive mode
Stream socket sends keep alive segments on timeout to keep
a connection alive.
For the command FIO_FLOW_CTRL the argument values are:
*argp value
Socket mode
Description
0
Normal mode
Stream socket dumps excess data, if the receiving buffer is
full.
nonzero
Flow-control mode
Stream socket controls the window size and stops the
transmitter, if the receiving buffer is full.
The ioctlsocket function is in the RL-TCPnet library. The
prototype is defined in rtl.h.
note
You must call the socket function before any other
function calls to the BSD socket.
If a negative number is returned, it represents an error
code.
In RTX environment the blocking mode is enabled by
default.
Return Value
The ioctlsocket function returns the following result:
SCK_SUCCESS
The function call is successful.
SCK_EINVALID
The socket identified with sock is invalid.
SCK_EINVALIDPARA
The function parameters are invalid or not supported.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.