in reply to Distributing Perl GUI Clients for Server Apps

What you're talking about is simply 'protocol'. As you control both sides of the communication, you can use any protocol you like - making one up to suit your needs would probably be as easy as bending another (HTTP, SOAP etc) to fit.

If, for instance, you're wanting to send a number of encrypted key-value pairs, this could be as simple as

use Crypt::Simple; print MYSOCKET encrypt(join(":",map {"$_=$vals{$_}"} keys %vals));
...and a quick split/map/decrypt on the other end will reproduce the hash.

RPC (and thus SOAP) is more often used where you're sending 'objects' back and forth, allowing a client to perform Remote Procedure Calls...overkill for simply sending 'data'.

Having just knocked out a moderately-sized wxWindows app btw, I can (charitably) say that the documentation gives you just enough (with a couple of very minor errors / omissions), and I'd definitely use it again for all my advanced GUI needs. :)

Cheers, Ben.

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

    So would I just be looking at something like IO::Socket? I haven't done much (read: any) socket programming before, any guidance is appreciated.

      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.

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