• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

NoRouteToHostException when the system starts with no network connection

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.,

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic