Sam,
You need to set your sockets to Non-blocking sockets using the following function twice:


NetLibSocketOptionSet(<the refNum>, <your socket>, netSocketOptLevelSocket, netSocketOptSockNonBlocking, &flag, sizeof(flag), <a timeout>, &err);

NetLibSocketOptionSet(<the refNum>, <your socket>, netSocketOptLevelTCP, netSocketOptTCPNoDelay, &flag, sizeof(flag), <a timeout>, &err);

This function must be inserted between NetLibSocketOpen and NetLibSocketBind, before you use NetLibSocketListen. This way, your socket will try to accept a incoming connection, but will not be stopped in NetLibSocketAccept. Of course, you will need to call NetLibSocketAccept often to check if a connection incomes.

Sorry my english.
Ricardo Wagner Brito - Fortaleza, Cear�, Brasil


From: "Sam Leong" <[EMAIL PROTECTED]>
Reply-To: "Palm Developer Forum" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Subject: hangs on NetLibSocketAccept until incoming connection made
Date: Thu, 8 Apr 2004 22:40:02 +0800

I am a new palm developer, I want to develop a server socket using NetLib.
I use NetLibSocketListen to start to listen the incoming connection. Then I
use NetLibSocketAccept to accept the incoming the connection, but my control
hangs on NetLibSocketAccept until incoming connection made. I want to run it
background or using some notify function to invoke the NetLibSocketAccept
but I don't know how to do it.
I also want to know Palm development support thread or not. If support, how
to do it?


Sam Leong



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

_________________________________________________________________
MSN Messenger: converse com os seus amigos online. http://messenger.msn.com.br



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

Reply via email to