Metrologic Optimus S Programming Manual page 176

"c" programming guide
Table of Contents

Advertisement

170
"C" Programming Guide For Optimus S/R
socket_state
socket_testfin
socket_txstat
If successful, it returns 0.
Return
On error, it returns -1.
The global variable errno is set to indicate the error condition encountered.
Refer to the header files for error codes.
See Also
Purpose
To get the socket status for a connection.
Syntax
char socket_state (int conno);
int conno;
Example
val = socket_state (conno);
Description
The function gets the socket status for a connection.
Return
The return value can be one of the following:
ESTABLISHED
SYN_SENT
SYN_RECEIVED
LISTEN
CLOSING
socket_rxstat, socket_txstat
See Also
Purpose
To check if the remote end of a connection is closed.
Syntax
int socket_testfin (int conno);
int conno;
Example
if (socket_testfin (conno)) Nclose (conno);
Description
The function checks if the remote end has closed the connection. (TCP only)
Return
If closed, it returns a non-zero value.
Otherwise, it returns 0.
See Also
Nclose
Purpose
To get the transmit status for a connection.
1
2
3
4
5
/* connection number */
/* connection number */

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents