On Thursday 03 June 2004 05:57 am, Petr Stetina wrote:
> Yes - without SysTaskDelay () following NetLibSocketShutdown () causes
> probably premature closing of socket and transmited data are lost even
> if last NetLibSend () did not return any error.
I looked up the SO_LINGER, and if disabled it will not attempt to send
pending data during a close(). NetLibSocketShutdown() seems superfluous to
me. It takes a while to send pending data and ultimately close both sides
of a connection.
What you can try is setting the linger time yourself (instead of zero in my
example). That should make NetLibClose() block for a maximum time or until
the pending data is sent.
linger.onOff = true;
linger.time = 10;
The default way I believe is to return from NetLibClose() immediately and
then do the pending and connection closing in the network thread.
Or you can change your protocol to work through a single connection. Or you
can have the server disconnect when complete and then recognize that via a
client-side read of zero bytes.
--
/* Chris Faherty <[EMAIL PROTECTED]> */
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/