Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Listening Socket in Tk

by merlyn (Sage)
on May 08, 2005 at 00:53 UTC ( [id://454945]=note: print w/replies, xml ) Need Help??


in reply to Listening Socket in Tk

If the same process is managing the screen and listening on the socket, you'll have some random amount of latency. There's no way around that. There will be times when your socket goes ready that Tk is busy thinking about the screen.

If you need to isolate the latency, put your communication protocol in a second process, and when it has an entire update for the Tk process, it can tap the Tk process on the shoulder and say "here's your new data". I'd do that with two cooperating POE processes (one POE-Tk, one just POE), or maybe an Event.pm loop for the latter.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://454945]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-24 08:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found