• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SocketConnection Timeout

 
rashidi ahad
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i try to develop apps that is similar to port scanner..
it will open several port randomly.

the problem is open connection method does not allow setTimeout.

once the open conn executed, if the host or port unavailable it will take 120 second before the application continue to open other host ort.

is there other ways to set/shorten the timeout value.. or perhaps terminate the method which run the connect?
 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The open method of the Connector class allows you to set the time outs. You can set it true. But this is only a hint to the protocol handler to throw an IntrruptedIOException, but some times it might not throw the exception at all. Hope this helps you in some way. Regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic