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.
In reply to endless loops for server and tk by hudo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |