Org.Mentalis.Security.Ssl.SecureSocket.EndConnect C# (CSharp) Method

EndConnect() public method

Ends a pending asynchronous connection request.
is a null reference (Nothing in Visual Basic). was not returned by a call to the method. was previously called for the asynchronous connection. An operating system error occurs while accessing the SecureSocket. The SecureSocket has been closed. An error occurred while negotiating the security protocol.
public EndConnect ( IAsyncResult asyncResult ) : void
asyncResult IAsyncResult The result of the asynchronous operation.
return void
		public override void EndConnect(IAsyncResult asyncResult) {
			if (SecureProtocol == SecureProtocol.None) {
				base.EndConnect(asyncResult);
				return;
			}
			// Make sure everything is in order
			if (asyncResult == null)
				throw new ArgumentNullException();
			if (m_ConnectResult == null)
				throw new InvalidOperationException();
			if (asyncResult != m_ConnectResult)
				throw new ArgumentException();
			// Process the (secure) EndConnect
			// block if the operation hasn't ended yet
			AsyncResult ar = m_ConnectResult;
            while(!ar.IsCompleted) {
                ar.AsyncWaitHandle.WaitOne(200, false);
            }
			m_ConnectResult = null;
			if (ar.AsyncException != null)
				throw ar.AsyncException;
		}
		/// <summary>