• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoRouteToHostException when the system starts with no network connection

 
Gurumoorthy Doraiswamy
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.,

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic