examples/test-server
changeset 12 ad264ee5d5ba
child 13 d6f681329542
equal deleted inserted replaced
11:352d5517f1f2 12:ad264ee5d5ba
       
     1 #! /usr/bin/perl
       
     2 
       
     3 # This is no real example, it is just for testing the
       
     4 # server. And the server is just for testing the Quancom.pm.
       
     5 # So - it's almost of no use for you :)
       
     6 
       
     7 use strict;
       
     8 use warnings;
       
     9 use POSIX qw(tmpnam);
       
    10 use Getopt::Long;
       
    11 
       
    12 use blib;
       
    13 use Quancom::Test::Server;
       
    14 
       
    15 $SIG{INT} = sub { warn "got INT, exit now\n"; exit 0; };
       
    16 
       
    17 my $opt_socket = 0;
       
    18 
       
    19 GetOptions("socket!" => \$opt_socket)
       
    20   or die "wrong option!\n";
       
    21 
       
    22 my $server = new Quancom::Test::Server $opt_socket ? tmpnam() : ();
       
    23 $server->run;