users@grizzly.java.net

Re: CometEngine in 1.0.20 dropping packets

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 04 May 2009 11:36:26 -0400

Salut,

Jeffrey Kesselman wrote:
> Hey Guys,
>
> I've run into what seems to be a clear race condition. I have two calls
> to notify in a row in my code. (One is a READ type the other is a
> Notify type).
> When they occur immediately right after each other, the second packet is
> silently dropped. if i put a 500 ms sleep between them, they work fine.
>
> is this a known race condition? Are there known work arounds other then
> the evil sleep?

If you synchronize your onEvent method, does it help? Another workaround
is to call CometContext.setBlockingNotification(true)....but I would try
first with sync to see if that help.

Thanks!

-- Jeanfrancois


>
> JK
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>