Hi Guillermo,

Use TCPSocket.Poll in your loop.

Cheers,

Marc


On Apr 15, 2007, at 11:44 AM, Guillermo wrote:

> I'm writing a client-server applications, the server send a command to
> the server and it need to wait for the response to continue.
>
> For example, imagine a database server the client send a packet:
>
> ....
> sendToServer("select * from customers")
> ....
>
> The sendToServer method has to send the packet and wait for the
> response, What is the better method to wait? now I have a simple loop
> but consumes a lot of CPU (I can't sleep the main thread):
>
> while not respArrived
>
> end while
>
> and in the socket event: respArrived=true
>
> Are there another method?
>
> Thanks in advance
>
>       Guillermo
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to