Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Otherwise can i use the socket() call instead of the above mentioned IO::Socket::INET->new() method and use 'fileno' to get the fd. Is it OK?. Please suggest if you know some other way. Thanks, Poornasub CreateServer { my($PORT) = 10066; my($ret); $server = IO::Socket::INET->new( Proto => 'tcp', LocalPort => $PORT, Listen => SOMAXCONN, Reuse => 1); die "can't setup server" unless $server; $client = $server->accept(); $client->autoflush(1); return $ret; } Can i use the below two lines of code for getting the fd before the return statement $ret = fileno $client; return $ret; And is it valid?.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to get the fd from socket perl call?.
by AgentM (Curate) on Apr 01, 2001 at 21:16 UTC |