SIPSorcery.SIP.SIPTLSChannel.EndAuthenticateAsServer C# (CSharp) Method

EndAuthenticateAsServer() public method

public EndAuthenticateAsServer ( IAsyncResult ar ) : void
ar IAsyncResult
return void
        public void EndAuthenticateAsServer(IAsyncResult ar)
        {
            try
            {
                SIPConnection sipTLSConnection = (SIPConnection)ar.AsyncState;
                SslStream sslStream = (SslStream)sipTLSConnection.SIPStream;

                sslStream.EndAuthenticateAsServer(ar);

                // Set timeouts for the read and write to 5 seconds.
                sslStream.ReadTimeout = 5000;
                sslStream.WriteTimeout = 5000;

                m_connectedSockets.Add(sipTLSConnection.RemoteEndPoint.ToString(), sipTLSConnection);

                sipTLSConnection.SIPSocketDisconnected += SIPTLSSocketDisconnected;
                sipTLSConnection.SIPMessageReceived += SIPTLSMessageReceived;
                //byte[] receiveBuffer = new byte[MaxSIPTCPMessageSize];
                sipTLSConnection.SIPStream.BeginRead(sipTLSConnection.SocketBuffer, 0, MaxSIPTCPMessageSize, new AsyncCallback(ReceiveCallback), sipTLSConnection);
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPTLSChannel EndAuthenticateAsServer. " + excp);
                //throw excp;
            }
        }