aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Continueous ping from server end point. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Continueous ping from server end point." Watch "Continueous ping from server end point." New topic
Author

Continueous ping from server end point.

mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 244

Hi,
Is there any way that i can get ping from server to client for a perticular time or the client side task is completed.
Like client is sending a large amount of data and server need to send a message for every second to clent.
Please guide me to solve this thing.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

mallikarjun dontamsetti wrote:
Is there any way that i can get ping from server to client for a perticular time or the client side task is completed.
Like client is sending a large amount of data and server need to send a message for every second to clent.
Please guide me to solve this thing.


What you are describing is a heartbeat. You want some mechanism for the client to confirm that the server is still alive.

If you trust the quality of your network, then you can use the socket reset exception to determine that it is okay. In general though, it is probably not a good idea to assume that a connected socket means the application on the other side is still alive.

If you want to confirm that the application on the other side is alive and able to continue working, you need to have support for it in the protocol. You need to add a heartbeat into your protocol.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Continueous ping from server end point.