Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / September 2006

Tip: Looking for answers? Try searching our database.

Help on Socket and URLConnection

Thread view: 
Mudit Khetan - 27 Sep 2006 06:45 GMT
Hi all,
I am trying to make some tutorial assignmemnts and example programs for
my classes. I'm trying to use the 'Socket' and 'URLConnection' classes.
I am wondering if I can set a timeOut and catch the exception when the
connection times out.  I'am implementing a simple webserver for which i
need this facility.
Thanks
hiwa - 27 Sep 2006 07:42 GMT
> Hi all,
> I am trying to make some tutorial assignmemnts and example programs for
[quoted text clipped - 3 lines]
> need this facility.
> Thanks
Generally or usually, if you use URLConnection, a higer level of remote
connection abstraction than Socket, you won't need Socket for your
application. URLConnection class has setReadTimeout() method for which
read operation would throw java.net.SocketTimeoutException when the
timeout expired.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.