Thanksuse IO::Socket; use strict; my $socket; my $line; my $child_pid; $socket = IO::Socket::INET->new ( PeerAddr => 'server.com', PeerPort => 1247, Proto => "tcp", Type => SOCK_STREAM ) or die "Could not create client.\n"; unless (defined($child_pid = fork())) {die "Cannot fork.\n"}; if ($child_pid) { while($line = <>) { #here I'm gonna make the server read some files and #throw stuff to the other socket } } else { while ($line = <$socket>) { #here I'm gonna make the server listen for stuff from #the other socket. The information that comes from this #connection will be store in files that will be accessed #by the parent process. Is this gonna work? 24x7? #Non-stop? } }
In reply to Need Help with Sockets, Please by Gorby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |