Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Re: Transmit file over socket

by Roger (Parson)
on Jan 20, 2004 at 07:44 UTC ( [id://322528]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Transmit file over socket
in thread Transmit file over socket

Could be. Thinking about the client/server program again, I would probably use the Net::TCP::Server module to implement the server. Much easier.
use strict; use warnings; use Net::TCP::Server; # create listener my $lh = 'Net::TCP::Server'->new(8000) or die; while (my $sh = $lh->accept) { defined(my $pid=fork) or die "fork: $!\n"; if ($pid) { # parent doesn't need client fh $sh->stopio; next; } # child doesn't need listener fh $lh->stopio; # do per-connection stuff here # read from the socket exit; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://322528]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-25 08:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found