On Thu, 19 Feb 2004, Jonathan Niedfeldt wrote:

> If I set it to "true" my NetLibSocketConnect() call returns an error of
> "netErrWouldBlock" and fails...

For those experienced in TCP/IP programming, this is expected behavior.
That return code is just letting you know that the connect operation is
not instantaneous... there is some delay involved and the connect call
would block for that if it were not set to non-blocking.

I've never done a non-blocking connect with Palm OS, so I'm not sure how
well it would work.  One way to get around this is to wait until after you
connect to set the socket to non-blocking.  Either that, or use
NetLibSelect to see if there's actually anything to read on the socket
first.  The latter is also the best way to tell if the socket was closed
by the server (if that's a possibility in this case)... NetLibSelect will
indicate that something can be read, but if you don't get anything from
NetLibReceive in that case then the connection has closed.

-- 
-----------------------------------------------------------------------
Brian Smith //  avalon73 at caerleon dot us  // http://www.caerleon.us/
Software Developer  //  Gamer  //   Webmaster  //  System Administrator
You're just jealous 'cause the voices talk to me...

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to