This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How should the client handle a lost connection to the server

 
Greenhorn
Posts: 7
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I'm just about ready to upload my project and register for the exam, just doing final checks, and I've one remaining question at the moment.
"How should the client handle a loss in connection to the server?"

At the moment, if I kill the server and then try and search, I show an error message to the user stating that the connection has been lost and that the user will need to restart the application.
Would you say that this is good enough? Or should I have some sort of reconnection mechanism?

Kind Regards,
Paul
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I'd say that's pretty much it.

Or should I have some sort of reconnection mechanism?



Well, since it isn't required, I wouldn't go for it.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with Roberto here. No need to implement reconnection for the client.

Well for me, I did a shutdown hook for the server. If the server is going to shut down I prolong for say 2 minutes informing connected clients about the shut down.

Of course this approach will have some sort of ping test once in a while. Again this is not required.
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic