• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Is Connectionalive (Urgent)

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am writing client program with the use of java. I want to know , when server gets disconnected or turn off the machine, how would I know that socket connection is still alive or not?
Is there any API or way to find this one out?
Thanks
Angela
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Angela Jessi:
Hi,
I am writing client program with the use of java. I want to know , when server gets disconnected or turn off the machine, how would I know that socket connection is still alive or not?
Is there any API or way to find this one out?
Thanks
Angela



Hi!..
i don't know is there any API provided by JAVA or not...
but..
i use this kind of method...
i tried to send something, i mean, anythings to the server using the same socket connection.
if the server reply, i will consider the connection is alive...
if not, i will consider, the connection is terminated..
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ariffin Ahmad,
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
If you have control over client side then create heart beat.
The server will cache the beats and if you do not receive next beat within timeout, then consider the server to be disconnected.
Yarik.
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is heat beat?
Thanks
angela

Originally posted by Yaroslav Chinskiy:
Hi,
If you have control over client side then create heart beat.
The server will cache the beats and if you do not receive next beat within timeout, then consider the server to be disconnected.
Yarik.


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic