in reply to Re: Socket hangs
in thread Socket hangs
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> "; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Socket hangs
by Celada (Monk) on Dec 23, 2005 at 19:35 UTC | |
by navarro (Initiate) on Dec 23, 2005 at 19:55 UTC | |
|
Re^3: Socket hangs
by mikeock (Hermit) on Dec 23, 2005 at 18:55 UTC | |
by navarro (Initiate) on Dec 23, 2005 at 19:15 UTC |