Re: Perl, GTK, Network

On Fri, 12 Dec 2003 09:00:29 -0700, Mark Lehrer wrote
I basically need to have the Gtk part send outgoing messages, but I
also need to respond to incoming messages and update a label to show
the latest incoming message... fairly basic I guess.

With perl-gtk-1, I used
    $my_socket = IO::Socket::INET->new( Proto => 'tcp',
                                       PeerAddr => $some_ip_addr,
                                       PeerPort => $some_port);

    $my_socket_object = Gtk::Gdk->input_add($my_socket->fileno, ['read'],
       \&socket_msg_handler, $my_socket);

sub socket_msg_handler{

   # Here I read from the socket (I was using unbufferred i/o).

   # In case nothing is read.

Don't know how things've changed since.

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