hudo has asked for the wisdom of the Perl Monks concerning the following question:
I need a UDP server on the xp machine who is sending constantly (every n seconds) to 5 clients (SPS) in a LAN even if the clients do not send a request (UDP is not reliable, maybe the SPS are dead).
The server is also receiving periodically requests from the clients and then responding them (normal operation of the system).
The requests should be displayed graphically (for instance with a perl/tk listbox).
How can I manage the timing, because in my opinion there are several endless loops
* the server should send
* the server should receive
* the endless loop of the perl/tk MainLoop with the periodically refreshed listbox.
For the perl/tk MainLoop I asked in this forum "listbox refresh with Tk::After" and got a working answer with the command repeat.
I got a server who receives/listens and responds immediately to request in a while (1){} loop. How can I integrate, that the server should also send periodically if there are no requests ? Maybe a timeout for the receiving loop ?
How can these demands be integrated in one programm ?
I would have thought of two different programms , a server and the graphically perl/tk programm, where the programms communicate via files, but there should be only ONE doswindow. Maybe it is possible to let the doswindow dissappear after e.g. the perl/tk programm is started ?
A last problem, the client who is not requesting after m seconds should be marked with a different color in the perl/tk GUI, for instance his last request should have a red background, all others have a green background. I think this is not possible with a normal listbox. What alternative would you suggest ?
I appreciate each hint, thanks in advance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: endless loops for server and tk
by zentara (Cardinal) on Aug 02, 2007 at 11:05 UTC | |
Re: endless loops for server and tk
by strat (Canon) on Aug 03, 2007 at 10:09 UTC | |
by hudo (Novice) on Aug 10, 2007 at 03:47 UTC | |
Re: endless loops for server and tk
by vkon (Curate) on Aug 02, 2007 at 15:38 UTC | |
Re: endless loops for server and tk
by BrowserUk (Patriarch) on Aug 02, 2007 at 15:48 UTC | |
by hudo (Novice) on Aug 10, 2007 at 03:35 UTC | |
by BrowserUk (Patriarch) on Aug 10, 2007 at 13:24 UTC | |
Re: endless loops for server and tk
by Errto (Vicar) on Aug 03, 2007 at 04:50 UTC |