in reply to Tk and socket question
How do I poll for input - as in:
while ($msg = <STDIN>) {}
while ($sock->recv($msg)) {}
Look up "Tk::fileevent":
Tk::fileevent - Execute a callback when a filehandle
becomes readable or writable
SYNOPSIS
$widget->fileevent(fileHandle,readable?,callback?)
$widget->fileevent(fileHandle,writable?,callback?)
DESCRIPTION
This command is used to create file event handlers. A
file event handler is a binding between a filehandle and a
callback, such that the callback is evaluated whenever the
filehandle becomes readable or writable. File event han
dlers are most commonly used to allow data to be received
from another process on an event-driven basis, so that the
receiver can continue to interact with the user while
|
|---|