jabber.connection.ConferenceManager.GetUniqueRoom C# (CSharp) Method

GetUniqueRoom() public method

Get a unique room name from the given server, and create a Room object for that room with the given nick. You'll be called back on "callback" when complete; the Room will be null if there was an error or timeout. Note: the server should implement the feature http://jabber.org/protocol/muc#unique, or this will return an error. To work around, just create a room with a Guid for a name.
public GetUniqueRoom ( string server, string nick, RoomStateEvent callback, object state ) : void
server string The server to send the request to
nick string The nickname desired in the new room
callback RoomStateEvent A callback to be called when the room is created
state object State object to be passed back when the callback fires
return void
        public void GetUniqueRoom(string server, string nick, RoomStateEvent callback, object state)
        {
            if (server == null)
                throw new ArgumentNullException("server");
            if (nick == null)
                throw new ArgumentNullException("nick");
            if (callback == null)
                throw new ArgumentNullException("callback");

            /*
            <iq from='[email protected]/desktop'
            id='unique1'
            to='macbeth.shakespeare.lit'
            type='get'>
              <unique xmlns='http://jabber.org/protocol/muc#unique'/>
            </iq>
             */
            UniqueIQ iq = new UniqueIQ(m_stream.Document);
            iq.To = server;
            BeginIQ(iq, new IqCB(GotUnique), new UniqueState(nick, callback, state));
        }