![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re: Querying a Server Periodicallyby termix (Beadle) |
on Dec 27, 2001 at 21:13 UTC ( #134648=note: print w/replies, xml ) | Need Help?? |
If the server and client are talking through TCP/IP and you are using sockets to implement that then you should be able to use select to detect when an event happens. You can use a time out with select. I believe a quick and dirty implementation could involve forking the client so that the parent handles communications (the select loop), while a child handles the user interface. The child and parent can communicate through TCP (or UNIX sockets) and the parent will be able to deal with that in the same select loop.
Hmmmm... Inelligant I believe, but then I'm not being graded on this (am I?). Multi threading would be much better. But I don't know what that would do to Perl/Tk -- termix
In Section
Seekers of Perl Wisdom
|
|