jabber.connection.HttpStanzaStream.Connect C# (CSharp) Method

Connect() public method

Connects the outbound socket.
public Connect ( ) : void
return void
        public override void Connect()
        {
            int port = (int)m_listener[Options.PORT];
            Debug.Assert(port > 0);

            m_sock = CreateSocket();

            string to = (string)m_listener[Options.TO];
            Debug.Assert(to != null);

            string host = (string)m_listener[Options.NETWORK_HOST];
            if ((host == null) || (host == ""))
                host = to;

            string url = (string)m_listener[Options.POLL_URL];
            if ((url == null) || (url == ""))
            {
            #if !__MonoCS__
                url = Address.LookupTXT("_xmppconnect.", to, "_xmpp-client-xbosh");
                if (url == null)
            #endif
                    throw new ArgumentNullException("URL not found in DNS, and not specified", "URL");
            }
            ((IHttpSocket)m_sock).URL = url;

            //Address addr = new Address(host, port);
            m_sock.Connect(null, (string)m_listener[Options.SERVER_ID]);
        }