Hi,

I run into exactly the same problem. So far I am still unable to find
a workable solution for non-blocking socket connection.

Apparently, the NetLibSocketOptionGet(netSocketOptSockErrorStatus)
does not work at all. I once try the NetLibSocketAddr() to see if the
socket is connected. However, NetLibSocketAddr() returns the remote
address as soon as DNS is performed, but before the actual socket
connection takes place.

Thus, I am able to decide if a socket is connected after performing a
non-blocking connect. Is there any good solution?

I have also tried calling NetLibSocketConnect() repeatedly on a
non-blocking socket. However, it returns netErrInternal on the Palm
Simulator.

So is there a workable non-blocking socket connection on the PalmOS?

Thanks a lot.

Tony Cheung

--- In [EMAIL PROTECTED], "Murad Kakabayev"
<[EMAIL PROTECTED]> wrote:
> Hello everybody,
> 
> I develop network application for PalmOS 4.0 and higher.
> For more frendly UI I want to use non-blocking socket calls.
> Here are my steps:
> 1) Create socket
> 2) make socket nonblocking
> NetLibSocketOptionSet(netSocketOptSockNonBlocking)
> 3) connect socket - NetLibSocketConnect - got netErrWouldBlock error
> 4) call NetLibSelect(&read, &write, &except)
> 5) analize result of NetLibSelect
> 
> It works on PalmOS Emulator (OS 4.0) and PalmOS Simulator (OS 5.2) but
> don't work on real device (I have Tungsten T). On TT NetLibSelect
returns
> immideately regardless of connection result (success, timeout,rejected).
> It's not a big problem if I can recognize socket state (if it
connected).
> But
> I did not find any approach to check the socket. Usually I use
> getsockopt(SO_ERROR) on other platforms, but on PALM OS I have strange
> result for analog of getsockopt - NetLibSocketOptionGet
> (netSocketOptSockErrorStatus)
> 
> 1) PALMOS emulator wanted 4-byte buffer for result and
> returns WIN32 Network error code (10XXX)  :-)
> 2) PALMOS simulator wanted 2-byte buffer and returns netErrUnimplemented
> 3) TungstenT  wanted 2-byte buffer and returns errNone
> 
> So I want make either NetLibSelect or NetLibSocketOptionGet
> (netSocketOptSockErrorStatus) work correct regardless of PalmOS
version and
> design. Or I want recognize if the socket connected.
> 
> Any ideas?
> Thank you,
> Murad Kakabayev
> 
> 
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to
unsubscribe, please see http://www.palmos.com/dev/support/forums/


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

Reply via email to