navarro has asked for the wisdom of the Perl Monks concerning the following question:
And then it is freeze. I know that server is ok becouse when i use netcat as client everythings goes nice, here is a piece of client`s code:----- # ./client.pl Connection estabilished from: Source IP-> 127.0.0.1 Source port-> 32894 command> uname Linux -----
Any help would be nice. Happy new year!sub listen() { $local = IO::Socket::INET->new(Listen=>1, Proto=>'tcp', LocalAddr=>'eth0', LocalPort=>5000, ReuseAddr=>1,) or die "$!"; $local->autoflush(1); $addr_handle = $local->accept(); $remotehost = $addr_handle->peerhost ; $remoteport = $addr_handle->peerport ; print "Connection estabilished from:\nSource IP-> $remotehost\nSource +port-> $remoteport\n"; print "command> "; while(defined ($comm = <STDIN>)) { print $addr_handle $comm; while(<$addr_handle>) { print STDOUT $_ } print "command> "; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Socket hangs
by salva (Canon) on Dec 23, 2005 at 12:51 UTC | |
by navarro (Initiate) on Dec 23, 2005 at 14:36 UTC | |
|
Re: Socket hangs
by mikeock (Hermit) on Dec 23, 2005 at 16:25 UTC | |
by navarro (Initiate) on Dec 23, 2005 at 18:13 UTC | |
by Celada (Monk) on Dec 23, 2005 at 19:35 UTC | |
by navarro (Initiate) on Dec 23, 2005 at 19:55 UTC | |
by mikeock (Hermit) on Dec 23, 2005 at 18:55 UTC | |
by navarro (Initiate) on Dec 23, 2005 at 19:15 UTC | |
|
Re: Socket hangs
by Anonymous Monk on Dec 23, 2005 at 12:23 UTC |