in reply to Re: Re: Distributing Perl GUI Clients for Server Apps
in thread Distributing Perl GUI Clients for Server Apps

Oh - sorry - you're *not* just talking about protocol... :)

IO::Socket is the OO version of the basic 'Socket' module - you can use either, though it's usually easier to use the first to do something like below...

A client...

use IO::Socket::INET; my $socket = IO::Socket::INET->new("${my_server}:${my_port}") or die $ +!; print $socket "My Ping\n"; my $answer = <$socket>; #should be 'My Pong' close $socket;
A server...
use IO::Socket::INET; my $server = IO::Socket::INET->new(LocalPort=>$my_port,Type=>SOCK_STRE +AM,Listen=>1) or die $!; while (my $client = $server->accept()) { my $message = <$client>; print $client "My Pong\n" if ($message =~/My Ping/); }
...which is obviously not going anywhere near production code, but should be enough to get started with. Check out the 'Sockets' section of the Camel Book for more info.

Cheers, Ben.

Replies are listed 'Best First'.
Re: Re: Re: Re: Distributing Perl GUI Clients for Server Apps
by Anonymous Monk on Aug 06, 2003 at 17:35 UTC

    Cool, that should get me started in the right direction, thanks again :)