1 #!/usr/local/bin/perl -s
6 $xskip = ( $^O eq 'solaris' ) ? 600 : 500 ;
8 use File::Basename qw( basename );
9 $ENV{PATH} .= ':' . basename( $0 ) . ':.';
10 <<<<<<< HEAD:bin/chat2_demo
13 >>>>>>> origin/master:bin/chat2_demo
14 for my $prog qw( run_stem xterm telnet ) {
15 die "Can't find $prog in PATH\n" if
16 system( "which $prog >/dev/null 2>&1" ) != 0;
21 $SIG{ 'INT' } = \&cleanup ;
26 $prompt = '-prompt Stem:' ;
27 $prompt2 = '-prompt Chat:' ;
28 $echo = 'console_echo=1'
31 foreach $cmd ( split /\n/, <<EOT ) {
32 xterm -T Chat1 -n Chat1 -geometry 80x25+XSKIP+0 -e $ssfe $prompt run_stem $echo chat_server
33 xterm -T Chat2 -n Chat2 -geometry 80x25+XSKIP+250 -e $ssfe $prompt run_stem $echo chat_client
34 xterm -T A -n A -geometry 80xLINE+0+OFF -e $ssfe $prompt2 telnet localhost 6666
35 xterm -T B -n B -geometry 80xLINE+0+OFF -e $ssfe $prompt2 telnet localhost 6667
36 xterm -T C -n C -geometry 80xLINE+0+OFF -e $ssfe $prompt2 telnet localhost 6668
37 xterm -T D -n D -geometry 80xLINE+0+OFF -e $ssfe $prompt2 telnet localhost 6669
40 $cmd =~ s/XSKIP/$xskip/ ;
42 $cmd =~ s/LINE/$line_cnt/ ;
43 $cmd =~ s/OFF/$base_off/ and $base_off += $offset ;
47 @cmd = split ' ', $cmd ;
52 sleep 2 unless $cmd =~ /localhost/ ;
75 if ( $pid = fork() ) {
77 push @children, $pid ;