XMPPRoomDidLeave delegate gets called after an idle time of 1min?? #290

Open
jundaj opened this Issue Jan 8, 2014 · 10 comments

Comments

Projects
None yet
4 participants
@jundaj

jundaj commented Jan 8, 2014

I'm creating XMPPRoom using the below mentioned code, the room gets created and everything works fine however, right after a min of idle time (not sending/receiving messages), this delegate "XMPPRoomDidLeave" gets called and kicks me out of xmpproom. after that, i cannot send or receive messages.

Did anyone else experience this issue? appreciate your help in advance.

- (void)createXMPPRoom:(NSString *)name
{
    // Configure xmppRoom
    XMPPJID *roomJID = [XMPPJID jidWithString:[Utilities roomIdForString:name]];
    XMPPRoomMemoryStorage *roomMemoryStorage = [[XMPPRoomMemoryStorage alloc] init];

    self.xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:roomMemoryStorage
                                                      jid:roomJID
                                            dispatchQueue:dispatch_get_main_queue()];

    [self.xmppRoom activate:self.xmppStream];
    [self.xmppRoom addDelegate:self delegateQueue:dispatch_get_main_queue()];

    [self.xmppRoom joinRoomUsingNickname:self.nickName history:nil];

}
@cboden

This comment has been minimized.

Show comment Hide comment
@cboden

cboden Mar 12, 2014

I'm experiencing the same issue. I have two other non-XMPPFramework clients connected who remain connected to the room but my app leaves.

cboden commented Mar 12, 2014

I'm experiencing the same issue. I have two other non-XMPPFramework clients connected who remain connected to the room but my app leaves.

@ObjColumnist

This comment has been minimized.

Show comment Hide comment
@ObjColumnist

ObjColumnist Mar 13, 2014

Collaborator

Anything get outputted in the console?

Collaborator

ObjColumnist commented Mar 13, 2014

Anything get outputted in the console?

@cboden

This comment has been minimized.

Show comment Hide comment
@cboden

cboden Mar 13, 2014

Nope. Is there something I can set somewhere to increase logging to help?

cboden commented Mar 13, 2014

Nope. Is there something I can set somewhere to increase logging to help?

@cboden

This comment has been minimized.

Show comment Hide comment
@cboden

cboden Mar 13, 2014

I'm reading up on the documentation to add Lumberjack and get some better logging.

In the mean time I get a notification that the room object has had its presence set to unavailable at which point my delegate method xmppRoomDidLeave is called. It was 2:20 after first connecting.

cboden commented Mar 13, 2014

I'm reading up on the documentation to add Lumberjack and get some better logging.

In the mean time I get a notification that the room object has had its presence set to unavailable at which point my delegate method xmppRoomDidLeave is called. It was 2:20 after first connecting.

@cboden

This comment has been minimized.

Show comment Hide comment
@cboden

cboden Mar 13, 2014

Looks like my server is sending a ping that XMPPFramework doesn't know how to pong to so the server disconnects the client.

2014-03-13 10:45:35:016 iTestApp[93534:3d1f] RECV: 
<iq xmlns="jabber:client" type="get" to="chris@myserver.com/iTestApp-1E97" from="rooms.myserver.com" id="qHjKwOPYT36Kh9LeborOyw=="><ping xmlns="urn:xmpp:ping"/></iq>

2014-03-13 10:45:35:017 iTestApp[93534:10f23] SEND:
<iq type="error" to="rooms.myserver.com" id="qHjKwOPYT36Kh9LeborOyw=="><ping xmlns="urn:xmpp:ping"/><error type="cancel" code="501"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>

2014-03-13 10:45:38:156 iTestApp[93671:982f] RECV:
<presence xmlns="jabber:client" to="chris@myserver.com/iTestApp-1E97" from="testroom@rooms.myserver.com/chris@myserver.com/iTestApp-1E97" type="unavailable"><x xmlns="http://jabber.org/protocol/muc#user"><item role="none" affiliation="owner"><actor jid="rooms.myserver.com"/><reason>Client has not responded to component ping</reason></item><status code="307"/><status code="110"/></x></presence>

cboden commented Mar 13, 2014

Looks like my server is sending a ping that XMPPFramework doesn't know how to pong to so the server disconnects the client.

2014-03-13 10:45:35:016 iTestApp[93534:3d1f] RECV: 
<iq xmlns="jabber:client" type="get" to="chris@myserver.com/iTestApp-1E97" from="rooms.myserver.com" id="qHjKwOPYT36Kh9LeborOyw=="><ping xmlns="urn:xmpp:ping"/></iq>

2014-03-13 10:45:35:017 iTestApp[93534:10f23] SEND:
<iq type="error" to="rooms.myserver.com" id="qHjKwOPYT36Kh9LeborOyw=="><ping xmlns="urn:xmpp:ping"/><error type="cancel" code="501"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>

2014-03-13 10:45:38:156 iTestApp[93671:982f] RECV:
<presence xmlns="jabber:client" to="chris@myserver.com/iTestApp-1E97" from="testroom@rooms.myserver.com/chris@myserver.com/iTestApp-1E97" type="unavailable"><x xmlns="http://jabber.org/protocol/muc#user"><item role="none" affiliation="owner"><actor jid="rooms.myserver.com"/><reason>Client has not responded to component ping</reason></item><status code="307"/><status code="110"/></x></presence>
@vitalyster

This comment has been minimized.

Show comment Hide comment
@vitalyster

vitalyster Mar 13, 2014

Contributor

@cboden you should activate XMPPPing extension

Contributor

vitalyster commented Mar 13, 2014

@cboden you should activate XMPPPing extension

@cboden

This comment has been minimized.

Show comment Hide comment
@cboden

cboden Mar 13, 2014

I tried adding XMPPPing.h and XMPPAutoPing.h, activating them on my XMPPStream, and testing their delegate methods. However they both seem to be client to server pining. Neither seems to receive pings from the server nor do they send pong replies.

cboden commented Mar 13, 2014

I tried adding XMPPPing.h and XMPPAutoPing.h, activating them on my XMPPStream, and testing their delegate methods. However they both seem to be client to server pining. Neither seems to receive pings from the server nor do they send pong replies.

@ObjColumnist

This comment has been minimized.

Show comment Hide comment
@ObjColumnist

ObjColumnist Mar 13, 2014

Collaborator

You need to set respondsToQueries to YES

Collaborator

ObjColumnist commented Mar 13, 2014

You need to set respondsToQueries to YES

@cboden

This comment has been minimized.

Show comment Hide comment
@cboden

cboden Mar 13, 2014

That would do it. Thanks @ObjColumnist and @vitalyster!

cboden commented Mar 13, 2014

That would do it. Thanks @ObjColumnist and @vitalyster!

@ObjColumnist

This comment has been minimized.

Show comment Hide comment
@ObjColumnist

ObjColumnist Mar 13, 2014

Collaborator

😄

Collaborator

ObjColumnist commented Mar 13, 2014

😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment