Chapter 3 Terminal Specific Function Library
141
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
Содержание Optimus R
Страница 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Страница 6: ......
Страница 8: ...2 C Programming Guide For Optimus S R...
Страница 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Страница 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Страница 24: ...18 C Programming Guide For Optimus S R...
Страница 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...
Страница 232: ...226 C Programming Guide For Optimus S R 4 11 Implementation defined Limits limits h float h Refer to limit h and float h...
Страница 238: ...232 C Programming Guide For Optimus S R...