• Post Reply Bookmark Topic Watch Topic
  • New Topic

setSoTimeout doesn't work sometimes  RSS feed

zheng li
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am usint org.apache.commons.net.telnet.TelnetClient to invoke scripts on a remote server.
i wrote 2 scripts on the server.
one is
sleep 30;echo success;
the other is
echo success;sleep 30;echo success;

and i set time out to 15s

if i call the second script, timeout works just fine, and throw sockettimeout exception.
but if i call the first one, it seems timeout is set to 0 (wait infinite), and telnetClient will wait 30s for the response.

please help.
thanks in advance.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!