Re: Problems with IO signal



On 04/02/01 David Weisgerber wrote:
How you described in your tutorial, you can use input_add to check for data 
on a file descriptor or socket. I did so but it won't work. Here is what I 
wrote:
$idmaster = Gtk::Gdk->input_add($socket, 'read', \&master_server, 0);

where $socket is a working network-socket of this type:
$socket = IO::Socket::INET->new(PeerAddr => $ip,
                                         PeerPort => $port,
                                         Proto => "udp")
      or error_dialog ("Fehler beim Verbinden mit dem Server");

I know that the sub master_server is never called although there are datas 
sent to $socket.

Does anybody know what I would have down wrong ???

Use $socket->fileno() in the input_add call.
The sample code in Gtk::cookbook does it.

lupus

-- 
-----------------------------------------------------------------
lupus debian org                                     debian/rules
lupus ximian com                             Monkeys do it better




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]