That is ok, but in some commands (i dont know why) i can execute them sucessfully and them i`ve freeze again, look:# ./client.pl Connected from: 127.0.0.1:33703 Command> >uname Linux Command> id nobody uid=99(nobody) gid=99(nogroup) groups=99(nogroup),98(nobody) Command>
And look what happens if i use ";" followed by some other command:Command> touch test
Here is the code:Command> touch test ; ls client.pl client.pl~ salvo.pl server.pl server.pl~ test Command>
Any tip? thanks.sub listen() { $local = IO::Socket::INET->new(Listen=>1, Proto=>'tcp', LocalAddr=>'eth0' LocalPort=>5000, ReuseAddr=>1,) or die "$!"; $local->autoflush(1); $addr = $local->accept(); $remotehost = $addr->peerhost ; $remoteport = $addr->peerport ; print "Connected from: $remotehost:$remoteport\n"; print "Command> "; while($comm = <STDIN>) { print $addr $comm; sub closeback() {exit(0)} while(sysread($addr,$buffer,1024)) { print $buffer; last; } print "Command> "; } }
In reply to Re^2: Socket hangs
by navarro
in thread Socket hangs
by navarro
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |