Thanks Steve but Is very complex to refactor, there are a lot of calls
to the server in a lot of methods, and the method must wait for the
answer to continue:
For example, imagine a SQL server:
.....
SQLSelect ----> call to the server and wait answer
for ...
SQLNext --- > calll to the server and wait answer
next
SQLExecute --> call to the server....
... and so on, Is very difficult to refactor all.
If theren't solutions perhaps RS could implement a "sleep" for the main thread.
Best regards
Guillermo
2007/4/18, Steve Garman <[EMAIL PROTECTED]>:
> In a message regarding Re: What is the correct method for synchronous
> client-server calls? dated Wed, 18 Apr 2007 10:41:19 +0200, Guillermo said
> that ...
>
> > I have the same problem using socket.poll, the loop consumes a lot of
> > CPU cycles while waiting for the answer:
>
> Any chance of refactoring your code into two methods?
>
> Method1 does the stuff up to the poll then stops
> The socket's dataAvailable event calls Method2
> Method2 calls Method1 again, if necessary
>
> Real life being more complex than that usually, I'm sure it will need more
> thought than that but just in case you hadn't considered it...
>
>
> --
> Steve Garman
> Using REALbasic Professional on Windows XP Pro
>
>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>