• Post Reply Bookmark Topic Watch Topic
  • New Topic

where can I find an example to use socket to read a web page?

 
Allen Chan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where can I find an example to use socket to read a web page? I use URL before but can't specifiy the time out.

any ideas?
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set the timeout of URL/URLConnection via the sun.net.client.defaultConnectTimeout system property. Take a look at
Networking Properties - Java 1.5.0 for more options.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://jakarta.apache.org/commons/httpclient/ supports connection timeouts and at the same time saves you from having to handle all the low level details.

Moving to Sockets and Internet Protocols...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!