On Oct 17, 2011, at 4:03 PM, Mike Mahoney wrote:

> 
> On Oct 17, 2011, at 2:54 PM, Niklas Gustavsson wrote:
> 
>> On Mon, Oct 17, 2011 at 6:32 PM, Mike Mahoney
>> <[email protected]> wrote:
>>> I've been looking into using Vysper's BOSH functionality and have a 
>>> question.  Is there any support for doing session attachment as described 
>>> here: http://metajack.im/2008/10/03/getting-attached-to-strophe/ ?
>>> 
>>> There didn't seem to be any support, but I wanted to make sure.  If anyone 
>>> has any thoughts on a good way to approach this I'd be happy to work on it, 
>>> since our project needs the functionality anyway.
>> 
>> From my reading of the post, it doesn't seem to require any support on
>> the server but should work just like regular BOSH. But, I might be
>> missing something.
>> 
>> /niklas
> 
> In general, I think it should work.  The problem is creating the 
> BoshBackedSessionContext on the server.  Right now, it is created from the 
> BoshHandler when it receives a 'body' element without a sid.  I was working 
> on building a filter that could execute when a user logs into our web app 
> that would setup the BoshBackedSessionContext and return the initial sid and 
> rid to the client.  However, just creating the Context and placing it in the 
> BoshHandlers Map of Contexts doesn't seem sufficient.  When I do that and 
> then send a BOSH request with initial presence I just get back an empty 
> response with no data (not even an empty body element).
> 
> -Mike

I finally got this working.  It was basically a three step process: 1. Expose a 
function to manually create a session, 2. Set the state of the session to 
AUTHENTICATED, 3. Manually to the session resource binding.  Not doing the last 
two is what was leading to my empty responses.

-Mike

Reply via email to