Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Listening Socket in Tk

by spurperl (Priest)
on May 09, 2005 at 10:06 UTC ( [id://455132]=note: print w/replies, xml ) Need Help??


in reply to Listening Socket in Tk

You can use threads (the "threads" module) to achieve this task. It works fine on Windows with Active Perl (version >= 5.8).

Making threads friends with Tk is a little bit tricky, but it certainly can be done and works just fine.

Here you can see what I've done with threads and Tk to work full duplex with a serial port, sockets should be very similar, and even simpler because socket support is very mature in Perl.

It works nicely on Windows with Active Perl.

Replies are listed 'Best First'.
Re^2: Listening Socket in Tk
by avo (Pilgrim) on May 11, 2005 at 09:34 UTC
    The problem is fixed. I just found that there is this in POE's Tk Loop for Active State Perl:

    $_handle_poller = $poe_main_window->after(100, [\&_poll_for_io]);

    This basicaly handles events while Tk is idle, which explains everything... All I did is I've changed the after time:

    $_handle_poller = $poe_main_window->after(1, [\&_poll_for_io]);

    Now I have no delays of any kind... my server is responding to my client immediately. Please don't hesitate to contact me for more information on this issue. As a conclusion I would like to recommend POE for proper Server-Client application on top of Tk. The things POE does is just pure magic. I personaly think that POE rocks!
    Keep the good work Rocco!!
    Anyway, Thank you all for the time and the suggestions!!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-25 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found