Win a copy of Kotlin in Action this week in the Kotlin forum!
  • 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
telnetClient.setSoTimeout(15000)

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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!