Simple TCP Clients : TCP « Network « Perl






Simple TCP Clients

    

#!/usr/bin/perl
use warnings;
use strict;
use IO::Socket;
my $sock = IO::Socket::INET->new('remote.host.com:7777');
while (<$sock>) {
    print "Server: $sock\n";
    print "Response?";
    my $response = <STDIN>;
    print $sock $response;
}

   
    
    
    
  








Related examples in the same category

1.TCP client
2.TCP client using Socket module.
3.TCP inet server
4.TCP server
5.tcp inet client
6.Sample TCP client without the Socket module.
7.Sample TCP client.
8.Example of a Perl TCP server using Socket module.