in reply to File/Data Streaming over a socket
####Server########### #!/usr/bin/perl use IO::Socket; my $server = IO::Socket::INET->new( Listen => 5, LocalAddr => 'localhost', LocalPort => 5050, Proto => 'tcp' ) or die "Can't create server socket: $!"; my $client = $server->accept; open FILE, ">out" or die "Can't open: $!"; while (<$client>) { print FILE $_; } close FILE; __END__ #and the Client ########## #!/usr/bin/perl use IO::Socket; my $server = IO::Socket::INET->new( PeerAddr => 'localhost', PeerPort => 5050, Proto => 'tcp' ) or die "Can't create client socket: $!"; open FILE, "in"; while (<FILE>) { print $server $_; } close FILE
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File/Data Streaming over a socket
by petesull (Initiate) on Mar 17, 2005 at 21:55 UTC | |
by zentara (Cardinal) on Mar 18, 2005 at 14:03 UTC | |
by starbolin (Hermit) on Mar 18, 2005 at 02:20 UTC |