Metrologic Optimus S Programming Manual page 147

"c" programming guide
Table of Contents

Advertisement

Example
if (socket_cansend (conno, strlen (buf)))
Nwrite (conno, buf, strlen (buf));
Description
This routine writes a number of bytes (len) from a specified buffer (buff) to a
connection (conno).
The protocol stack will keep the data and send them in background. Normally,
this routine will return immediately. However, it will take 1 to 8 seconds to
send the data in the following cases:
Case 1 - In TCP, four packets have been sent, but never get any ACK. The
protocol stack will try to resend the packets until it times out (i.e. 8 seconds).
The application can avoid this situation by using socket_cansend to make sure
the transmission is available before calling Nwrite().
Case 2 - In UDP, the protocol stack does not get MAC ID of the remote side. It
will take 1 second to ask the remote side for MAC ID by ARP.
Return
If successful, it returns the number of bytes written.
On error, it returns a negative value to indicate a specific error condition.
See Also
Nread, socket_cansend
Chapter 3 Terminal Specific Function Library
141

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents