Tags: access, accessing, acquired, applications, consistent, internet, java, network, outlook, programming, socket, socketexception, windows

SocketException "network is down" Windows 98

On Java Studio » Java Socket Programming

2,503 words with 2 Comments; publish: Thu, 20 Sep 2007 08:40:00 GMT; (15062.50, « »)

Hi,

I have recently acquired a consistent problem accessing the internet through Java applications. Access through IE and Outlook is fine.

Applications run on a stand-alone Windows 98 PC.

Nothing I am aware of has changed recently.

I suspect there is something wrong with my Windows configuration, but don't know where to look.

Would appreciate all suggestions.

Regards,

David Wilson

Further details:

java version "1.4.1_01"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)

Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

The following debugging program yields this exception with no bytes

exchanged over the net:

Network is down: connect

java.net.SocketException: Network is down: connect

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)

at

java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)

at java.net.Socket.connect(Socket.java:426)

at java.net.Socket.connect(Socket.java:376)

at java.net.Socket.<init>(Socket.java:291)

at java.net.Socket.<init>(Socket.java:119)

at WebProbe.<init>(WebProbe.java:23)

at WebProbe.main(WebProbe.java:12)

Code:

import java.net.*;

import java.io.*;

class WebProbe {

Socketsock;

DataInputStream dis;

DataOutputStream dos;

public static void main(String args[]) throws IllegalArgumentException {

new WebProbe(args);

}

public WebProbe(String args[]) throws IllegalArgumentException {

if (args.length != 2) {

System.out.println("Usage: ...");

throw new IllegalArgumentException();

}

try {

sock = new Socket(args[0], new Integer(args[1]).intValue());

dis = new DataInputStream(sock.getInputStream());

dos = new DataOutputStream(sock.getOutputStream());

System.out.println("connected okay");

}

catch(Exception e) {

System.out.println(e.getMessage());

e.printStackTrace();

}

}

}

All Comments

Leave a comment...

  • 2 Comments
    • Doh! who changed my firewall :)
      #1; Mon, 09 Jul 2007 20:30:00 GMT
    • "Network is down" relates to an underlying failure in the network stack. In other words, it's nothing to do with J2SE and you will probably see any winsock applications failing in a similiar manner.
      #2; Mon, 09 Jul 2007 20:30:00 GMT