aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes NoRouteToHostException when the system starts with no network connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "NoRouteToHostException when the system starts with no network connection" Watch "NoRouteToHostException when the system starts with no network connection" New topic
Author

NoRouteToHostException when the system starts with no network connection

Gurumoorthy Doraiswamy
Greenhorn

Joined: Jan 15, 2013
Posts: 21
Hi,

We have UDP client which we run as windows service using Java service wrapper. My problem is when the system starts with no network connection and when the service starts automatically i receive the "NoRouteToHostException".

How to resolve this? we tried with Datagramsocket.setReuseAddress(true) but still no use. The Datagramsocket.isconnected() always return false.

Can anyone suggest how to resolve this.

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Can you catch the Exception and set up a loop with a timer to check for a connection - say - once a minute?

Bill
Gurumoorthy Doraiswamy
Greenhorn

Joined: Jan 15, 2013
Posts: 21
Many thanks for the update.

I have performed the same for now to fix the issue. But is there any option like checking the datagram connected state ... etc.,

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoRouteToHostException when the system starts with no network connection