Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use IO::Socket; my $sock = new IO::Socket::INET ( PeerAddr '192.168.1.1', PeerPort => '7070', Proto => 'tcp', ); die "Could not create socket: $!\n" unless $sock; $file = "1MB.txt"; open (LOG, $file); @1MB = <LOG>; print $sock "@1MB"; close($sock);
use IO::Socket; my $sock = new IO::Socket::INET ( LocalHost > '192.168.1.1', LocalPort => '7070', Proto => 'tcp', Listen => 1, Reuse => 1, ); die "Could not create socket: $!\n" unless $sock; my $new_sock = $sock->accept(); while(defined(<$new_sock>)) { print $_; } close($sock);
Edit, BazB: added code tags.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I send more than 1MB to a TCP socket?
by hawtin (Prior) on Oct 26, 2003 at 15:17 UTC | |
|
Re: How can I send more than 1MB to a TCP socket?
by sauoq (Abbot) on Oct 26, 2003 at 17:40 UTC | |
|
Re: How can I send more than 1MB to a TCP socket?
by vek (Prior) on Oct 26, 2003 at 17:42 UTC | |
|
Re: How can I send more than 1MB to a TCP socket?
by pg (Canon) on Oct 26, 2003 at 17:36 UTC | |
by theorbtwo (Prior) on Oct 26, 2003 at 17:45 UTC | |
|
Re: How can I send more than 1MB to a TCP socket?
by pg (Canon) on Oct 26, 2003 at 18:12 UTC |