SIPSorcery.SIP.SilverlightTCPSIPChannel.Connect C# (CSharp) Method

Connect() public method

public Connect ( IPEndPoint remoteEndPoint ) : void
remoteEndPoint System.Net.IPEndPoint
return void
        public void Connect(IPEndPoint remoteEndPoint)
        {
            m_isConnecting = true;
            m_remoteEndPoint = remoteEndPoint;

            m_sipConnection = new SIPConnection(this, m_socket, m_remoteEndPoint, SIPProtocolsEnum.tcp, SIPConnectionsEnum.Caller);
            m_sipConnection.SIPSocketDisconnected += SIPSocketDisconnected;
            m_sipConnection.SIPMessageReceived += SIPTCPMessageReceived;

            m_socketConnectionArgs = new SocketAsyncEventArgs();
            m_socketConnectionArgs.RemoteEndPoint = m_remoteEndPoint;
            m_socketConnectionArgs.Completed += SocketConnect_Completed;
            m_socket.ConnectAsync(m_socketConnectionArgs);
            //if (!m_socket.ConnectAsync(m_socketConnectionArgs))
            //{
            //    throw new ApplicationException("Asynchronous socket connect operation unexpectedly returned synchronously.");
            //}
        }