• Post Reply Bookmark Topic Watch Topic
  • New Topic

Networking question  RSS feed

 
Ed Nodelman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run the following program:

import java.net.*;
import java.io.*;
public class saveHTML
{
public static void main(String[] args) throws Exception
{
try {
URL js = new URL("http://www.javasoft.com/");
System.out.println(js);

InputStream is = js.openStream();

System.out.println("2");
BufferedReader in = new BufferedReader(new InputStreamReader(is));

String inputLine;
while ((inputLine = in.readLine()) != null)
{
System.out.println(inputLine);
}
in.close();
} catch (Exception e)
{
System.out.println(e);
}
}
}

Right after the URL object is created and displayed, I am getting
the following exception:
"java.net.SocketException: descriptor not a socket: no further
information"
The exception is thrown by "openStream".
Any suggestions?
Thanks,
Ed
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the system connected to the Internet when you test the program?
 
Ed Nodelman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tony Alicea:
Is the system connected to the Internet when you test the program?

Yes, it's connected to the Internet.
Also, whats strange, I get different exceptions at home and at work. At work, I am getting UnknownHostException. Could this be
because of the firewall? At work I am using NT and I have WIN95
at home.
Thanks,
Ed
 
Ed Nodelman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved the problem. The solution? Upgraded winsoc
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!