This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes how to change default Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to change default "timeout" ?" Watch "how to change default "timeout" ?" New topic

how to change default "timeout" ?

Rahul Kothari

Joined: Oct 22, 2003
Posts: 1
i have a portscanner program and i want to add an option to the prog to change the default timeout. how do i do that ? i m pretty new to java, so dunno much. also, i srched on but much of it went over my head.
how much is the default timeout anyways ?

Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
The Socket class has a setSoTimeout() method which is probably what you want. There's also a connect() method with timeout option, but since the Socket constructor you're using returns a socket that's already connnected, that probably isn't necessary.

"I'm not back." - Bill Harding, Twister
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: how to change default "timeout" ?
Similar Threads
Do while error, I'm going crazy
another small question
Port Scan
How close am I in getting this program right?