-- I'm sorry for my English.
Hi everyone.
I'm searching and searching and can't find a solution for this :(
I am developing a social app in php, and using XMPP with Strophe for
giving it real time notification (new comments, new entries, etc...).
To do it, when loggin the user connects to ejjabered and join to a
room in a MUC, and just send message stanzas when new notification has
to be send.
Ok, this works as wanted, there is no difficult in it.
This app works always in only one page/tab, using AJAX. But now I want
to have the XMPP connection between differents tabs, so I attach the
connection in the new tab/tabs.
This is a basic use case about what is happening:
- User log in to the system, this creates a new XMPP connection (as
I'm doing until now) in the client side using Strophe. When this
happens the XMPP connection is JSON serialized and saved in a cookie
(to get later the jid, sid and rid). Adding handlers to the stanzas,
joining to the room etc, etc.
- The user open now a new tab. It's already logged, so I get the
cookie, create a new Strophe.connection and call attach(jid, sid, rid
+1), and then saving it into the cookie, adding handlers to the
stanzas, joining to the room etc, etc (I have to do it again, if I
don't there is no new notifications).
At this moment, my ejjabered log looks like this:
=INFO REPORT==== 2010-10-20 15:10:58 ===
I(<0.359.0>:ejabberd_listener:232) : (#Port<0.2886>) Accepted
connection {{127,0,0,1},42317} -> {{127,0,0,1},5280}
=INFO REPORT==== 2010-10-20 15:10:58 ===
I(<0.389.0>:ejabberd_http:137) : started: {gen_tcp,#Port<0.2886>}
=INFO REPORT==== 2010-10-20 15:11:01 ===
I(<0.391.0>:ejabberd_c2s:705) : ({socket_state,ejabberd_http_bind,
{http_bind,<0.390.0>,{{127,0,0,1},42317}},ejabberd_http_bind})
Accepted authentication for jiortiz by ejabberd_auth_anonymous
=INFO REPORT==== 2010-10-20 15:11:04 ===
I(<0.391.0>:ejabberd_c2s:828) : ({socket_state,ejabberd_http_bind,
{http_bind,<0.390.0>,{{127,0,0,1},42317}},ejabberd_http_bind}) Opened
session for jiortiz@unforgivens/jiortiz
=INFO REPORT==== 2010-10-20 15:11:06 ===
I(<0.392.0>:mod_muc_room:126) : Created MUC room
listadel...@conference.unforgivens by jiortiz@unforgivens/jiortiz ++
+ if the MUC is not created +++
+++ this is the log for the initial connection +++
=INFO REPORT==== 2010-10-20 15:12:20 ===
I(<0.359.0>:ejabberd_listener:232) : (#Port<0.2911>) Accepted
connection {{127,0,0,1},42327} -> {{127,0,0,1},5280}
=INFO REPORT==== 2010-10-20 15:12:20 ===
I(<0.394.0>:ejabberd_http:137) : started: {gen_tcp,#Port<0.2911>}
++++ And this is the log for the attach +++
- Now user open a new tab, just like the last step (the rid now is the
last rid+1, so is the first rid+2, and so on...), and my ejjabered log
looks like this:
=ERROR REPORT==== 2010-10-20 15:14:15 ===
E(<0.394.0>:ejabberd_http_bind:765) : Error on HTTP put. Reason:
bad_key
=ERROR REPORT==== 2010-10-20 15:14:15 ===
E(<0.390.0>:ejabberd_http_bind:386) : Closing bind session
"2bddcf4e28a92fed56ade1da32ab6e3997748734" - Reason: {put_error,
bad_key}
=INFO REPORT==== 2010-10-20 15:14:15 ===
I(<0.391.0>:ejabberd_c2s:1354) : ({socket_state,ejabberd_http_bind,
{http_bind,<0.390.0>,{{127,0,0,1},42317}},ejabberd_http_bind}) Close
session for jiortiz@unforgivens/jiortiz
=INFO REPORT==== 2010-10-20 15:14:15 ===
I(<0.392.0>:mod_muc_room:991) : Destroyed MUC room
listadel...@conference.unforgivens because it's temporary and empty
=INFO REPORT==== 2010-10-20 15:14:15 ===
I(<0.392.0>:mod_muc_room:732) : Stopping MUC room
listadel...@conference.unforgivens
=ERROR REPORT==== 2010-10-20 15:14:15 ===
E(<0.389.0>:ejabberd_http_bind:762) : no session associated with sid:
"2bddcf4e28a92fed56ade1da32ab6e3997748734"
=ERROR REPORT==== 2010-10-20 15:14:15 ===
E(<0.394.0>:ejabberd_http_bind:762) : no session associated with sid:
"2bddcf4e28a92fed56ade1da32ab6e3997748734"
=ERROR REPORT==== 2010-10-20 15:14:17 ===
E(<0.389.0>:ejabberd_http_bind:762) : no session associated with sid:
"2bddcf4e28a92fed56ade1da32ab6e3997748734"
And here is where I cry :P
Really, without the attachment the app works like a charm, but if I
want to add this new functionality it crashed as you can see.
If anyone can help I really appreciate it.
Thanks.
noone? :(
noone? :(