users@grizzly.java.net

Re: Connection Stability/Reconnector

From: Gustav Trede <gustav.trede_wsdevel_at_telia.com>
Date: Fri, 15 Aug 2008 02:26:48 +0200

can do it several ways depending on your usage case.

client send ping with interval X sec, if no response within Y sec ,
client closes connection and creates a new one.

server can also send a ping that does not require an ack, client simply
reconnects if it misses a ping (x+y sec timer).
using comet streaming mode, its very efficent since no http protocol
overhead a 300-400 bytes is needed for the ping.

I switched from using JMS to custom comet messaging with HA demands.

My usage case is to keep client data caches uptodate using streaming
comet, so client sends a cache status msg on connect/reconnect, server
then sends whats needed.
I have only done some initial simpler tests , i bet some special case
probems will show sooner or later.

regards
 gustav

Eric Faden skrev:
> I am interested in using Grizzly to replace my current custom link
> code. I was wondering how I would go about setting up a link level
> ping protocol to attempt to detect link failure. I want to use this
> ping protocol to bring the link down on "failure" and then reestablish
> it (so I don't need to wait for TCP timeout). Anyone have suggestions
> on the best way to do this? Basically I am trying to setup a server
> with a bunch of clients. I want the server and the clients to
> periodically send pings and then bring the link down if a ping hasn't
> been received for some amount of time. The client should reconnect
> and the server should just discard the connection. Thoughts?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>
>