XMPP/ejabberd MUC: can't join more than 11 rooms
<p>I am currently developing an iOS app using MUC with ejabberd and XMPP. Everything seemed to work fine, until we started to join the user to more than 11 chat rooms at the same time.</p>

<p>The first 11 chat rooms were connected without any problems using the following code:</p>

<pre><code>self.xmppRoomStorage = XMPPRoomCoreDataStorage(databaseFilename: "\(self.roomID).sqlite", storeOptions: nil)
    let roomJID = XMPPJID.jidWithString(roomJid)

    if roomJID != nil &amp;&amp; self.xmppRoomStorage != nil {
        print("Preparing to Activating room -&gt; \(roomJID)")

        self.xmppRoom = XMPPRoom(roomStorage: self.xmppRoomStorage, jid: roomJID, dispatchQueue: dispatch_get_main_queue())
        self.xmppRoom!.addDelegate(delegate, delegateQueue: dispatch_get_main_queue())
        self.xmppRoom!.activate(stream)

        self.xmppRoom!.joinRoomUsingNickname(ChatHelper.getLocalUserJid(), history:nil)
    }
</code></pre>

<p>When a user has successful joined a room, the following delegate is then called:</p>

<pre><code>func xmppRoom(sender, occupantDidJoin, withPresence)
</code></pre>

<p>However, any more than 11 chat rooms, and the user is unable to connect (they can still connect to the first 11). XMPP is not returning an error, it is just saying it failed to join the chat room.</p>

<p>I have tried adding a 1 second delay between each of the <code>dispatch_after(delayTime, dispatch_get_main_queue())</code> being called but this has not fixed the issue (we thought it might be connecting too fast).</p>

<p>Can anyone suggest what this might be? We are confident Ejabberd is configured correctly but it is hard to know without knowing what to look for...</p>