Hi,

This is what I really want to do, talk to a data source other than DB
by UDP.

I have to make my turbogears program talk to a remote server by UDP,
which means while handling a http request in controller.py,  I have to
send out an UDP package and block the thread until the response is
received.

I have little idea of how to make this happen.  Maybe I could write
another thread to send and receive packages, and wake up the waiting
thread correctly.

Do u have any suggestions?  Thanks a lot?

By the way, I also need to process the binary data in UDP packages, and
it's a little complicated to use struct.  Is there any more convenient
packages that you may recommend?

Thanks again!

On Nov 15, 9:23 am, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> "一首诗" <[EMAIL PROTECTED]> writes:
> > how to make an asynchronous process synchronized without having any
> > tight loops?Just call for the results and wait for it to be returned.  If 
> > you have too
> many calls them you'll have to support too many connections to the database
> and the ammount of data being handled.
>
> > Or how did they made it possible to make db operation just like a
> > function call without considering any asynchronoused problem?It is easier 
> > to deal with synchronous stuff than asynchronous stuff...
>
> > Where could I save the socket which would be used to communicate with
> > the remote server?  It will be awful to create it each time I need 
> > it?Explain what you're willing to do.  If it is a database server you'll 
> > probably
> end up with a connection pool.  This makes it better to reuse idle
> connections.
> 
> --
> Jorge Godoy      <[EMAIL PROTECTED]>


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to