166
"C" Programming Guide For Optimus S/R
Description
This function sets non-blocking operation back to blocking operation.
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
socket_cansend
Purpose
To check if data can be sent.
Syntax
int socket_cansend (int conno, unsigned int len);
int conno; /* connection number */
unsigned int len; /* number of bytes to write */
Example
if (socket_cansend (conno, strlen (buf)))
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.
See Also
Nwrite
socket_fin
Purpose
To set the FIN flag on the next outgoing TCP segment.
Syntax
int socket_fin (int conno);
int conno; /* connection number */
Example
val = socket_fin (conno);
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
Summary of Contents for Optimus R
Page 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Page 6: ......
Page 8: ...2 C Programming Guide For Optimus S R...
Page 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Page 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Page 24: ...18 C Programming Guide For Optimus S R...
Page 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...