users@grizzly.java.net

Change cometcontext for handler

From: Umar Farman <ufarman_at_pakvistatech.com>
Date: Fri, 22 May 2009 08:33:30 +0500

Hope everyone is fine.

I would like assistance in this scenario:

I have two cometContexts doing HTTP streaming to various clients.

Clients connect to contexts through making cometHandlers.

For example, if client X want to join context A and B, then he'll make two
handlers, one will be added to A and the other to B.

What i'm trying to achieve is that if client X is connected to context A,
now he sends a request to server, asking to change his context from A to B,
the server should create a new handler (B) for client X, attach the handler
A's response to handler B. Add handler B in context B, then remove the
handler A from context A and unregister context A.

What happens is everything goes on fine at the server side, but the client,
which was receiving data through conext A and now must receive data from
context B, does not receive any data.

The issue arrises where I use contextA.removeCometHandler(handler A). After
this point, no data is received by the client.

Kindly, assist me in figuring out why this is happening.

Regards,
Umar Farman
Software Engineer
PakVista Technologies Co. (Pvt) Ltd.
Office No.18, 3rd Floor, Select Center,
F-11 Markaz - Islamabad.
Office: +92 51 831 4504-5
Cell : +92 3333 525 4003
URL: www.pakvistatech.com <http://www.pakvistatech.com/>