> Server:
> #!/usr/bin/perl
> use IO::Socket;
> my $sock = new IO::Socket::INET (
> LocalHost => 'IP_GOES_HERE',
> (<-- yes this
> is set properly)
> LocalPort => '60000',
> Proto => 'tcp',
> Listen => 1,
> Reuse => 1,
> );
> die "Could not create socket: $!\n" unless $sock;
>
> my $new_sock = $sock->accept();
> while(defined(<$new_sock>)) {
> print "Socket defined\n";
> print $_;
> }
> close($sock);
>
> Client:
> #!/usr/bin/perl
> use IO::Socket;
> my $sock = new IO::Socket::INET (
> PeerAddr => 'IP_GOES_HERE',
> PeerPort => '60000',
> Proto => 'tcp',
> );
> die "Could not create socket: $!\n" unless $sock;
> print "$sock\n";
> print $sock "test\n";
> close($sock);
>
Are you starting the server first and verify that it is listening (use
netstat and grep for the port) ?
try autoflushing the socket handle:
$new_sock->autoflush(1); # put this after the line
"while(defined(<$new_sock>))
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]