#!/usr/bin/perl -w # ============================================================================== # IMIP COMMUNICATIONS NODE # - foundation of a state-machine networking daemon # ============================================================================== use strict; use IO::Select; use Fcntl; use Errno qw(EWOULDBLOCK); use Getopt::Std; #use Tie::RefHash; $| = 1; # for debugging # ------------------------------------------------------------------------------ # constants my $MSG_EOL = "\015\012"; my $MSG_TERM = ".$MSG_EOL"; my $MSG_EOL_ACCEPT = '\015?\012'; my $MSG_TERM_ACCEPT = "$MSG_EOL_ACCEPT\\.$MSG_EOL_ACCEPT"; my $MAX_CHUNK = 62*1024; # ------------------------------------------------------------------------------ # options use vars qw( $opt_d $opt_D ); getopts('dD'); $debug = $opt_D ? 2 : $opt_d ? 1 : 0;