File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How should the client handle a lost connection to the server

 
Paul Simon Connolly
Greenhorn
Posts: 7
IntelliJ IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
K. Tsang
Bartender
Pie
Posts: 3222
12
Android Java
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic