Example #1
0
        private bool Connect()
        {
            if (null == _strVoiceServerHostname)
            {
                _strVoiceServerHostname = "localhost";
            }
            if (!m_voipclient.Connect(_strVoiceServerHostname, _iVoiceServerPort, kiUDPPort, 0, 0))
            {
                logDebugOnly(String.Format("Failed to connect to voice server"));
            }

            //wait until we get connected.
            int  tries     = 0;
            int  maxTries  = 20;
            bool isRunning = false;

            while (!isRunning && tries < maxTries)
            {
                Thread.Sleep(100);
                isRunning = m_voipclient.IsConnected();
            }
            if (isRunning)
            {
                logDebugOnly("Connection to Conaito server succeeded\n");
                // wait for OnConnectSuccess or OnConnectFailed event
                updateButtonStates();
                return(true);
            }
            else
            {
                logDebugOnly("Connection to Conaito server failed\n");
                return(false);
            }
        }
Example #2
0
 private bool Connect()
 {
     if (voipclient.Connect(kstrHost, kiTCPPort, kiUDPPort, 0, 0))
     {
         // wait for OnConnectSuccess or OnConnectFailed event
         updateButtonStates();
         return(true);
     }
     else
     {
         this.textBoxLog.Text += "Failed to connect to Conaito server\n";
         return(false);
     }
 }
Example #3
0
        private bool Connect()
        {
            if (null == _strVoiceServerHostname)
            {
                _strVoiceServerHostname = "localhost";
            }
            if (!m_voipclient.Connect(_strVoiceServerHostname, _iVoiceServerPort, kiUDPPort, 0, 0))
            {
                //logDebugOnly(String.Format("Failed to connect to voice server"));
            }

            //wait until we get connected.
            int  tries     = 0;
            int  maxTries  = 20;
            bool isRunning = false;

            while (!isRunning && tries < maxTries)
            {
                Thread.Sleep(100);
                isRunning = m_voipclient.IsConnected();
            }
            return(isRunning);
        }