[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-users
Subject:    RE: sockets problem
From:       "Joe Schell" <jschell () doradosoftware ! com>
Date:       2001-05-31 23:19:06
[Download RAW message or body]



> -----Original Message-----
> Behalf Of James McDermet
> 
> 
> In the script below when I send a "START" msg to the socket it is
> successfully received.  When I send a "STOP" msg it is not.  What am I
> doing wrong here?
> 
> James
> 
> 
> use strict;
> use IO::Socket;
> 
> my $client;
> my $server_port = "5010";
> 
> my $server = IO::Socket::INET->new(LocalPort => $server_port,
>                                    Type      => SOCK_STREAM,
>                                    Reuse     => 1,
>                                    Listen    => 5 )
>     or die "Couldn't be a tcp server on port $server_port : $@\n$!\n";
> 
> while ( $client = $server->accept() ) {
>     if ( <$client> =~ /START/ ){
>         msgBox("Starting client...");
>         logEvent("Starting client...");
>     } elsif ( <$client> =~ /STOP/ ) {
>         msgBox("Stopping client...");
>         logEvent("Stopping client...");
>     }
> }
> 

Only a guess...

  # Extract something from a stream
  if ( <$client> =~ /START/ ){
  ...
  # Extract it again???? (it was already extracted)
  } elsif ( <$client> =~ /STOP/ ) {

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic