Metrologic Optimus S Programming Manual page 172

"c" programming guide
Table of Contents

Advertisement

166
"C" Programming Guide For Optimus S/R
socket_cansend
socket_fin
This function sets non-blocking operation back to blocking operation.
Description
Blocking operation is the default behavior for network functions. When in
blocking operation, calls to network functions will run to completion, or return
a timeout error if an associated time limit is run out.
Return
If successful, it returns 0.
On error, it returns a negative value. (?)
See Also
socket_noblock
To check if data can be sent.
Purpose
int socket_cansend (int conno, unsigned int len);
Syntax
int conno;
unsigned int len;
if (socket_cansend (conno, strlen (buf)))
Example
Nwrite (conno, buf, strlen (buf));
Description
This function checks if the amount of data (byte count) specified by len can be
written out immediately to the connection specified conno.
Return
If okay, it returns a non-zero value.
Otherwise, it returns 0.
Nwrite
See Also
To set the FIN flag on the next outgoing TCP segment.
Purpose
Syntax
int socket_fin (int conno);
int conno;
val = socket_fin (conno);
Example
Description
The next TCP segment to be written, following a call to this function, will have
the FIN flag set in the TCP header. This is useful for shutting down a
connection at the same time that the last segment is sent. After that, call
Nclose() to finish closing the connection. Note that Nclose() will not send a
FIN segment in this case.
Return
If successful, it returns 0.
Otherwise, it returns -1.
See Also
Nclose
/* connection number */
/* number of bytes to write */
/* connection number */

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents