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

EndAccept() public method

Ends an asynchronous request to create a new SecureSocket to accept an incoming connection request.
The returned VirtualSocket can be cast to a SecureSocket if necessary.
is a null reference (Nothing in Visual Basic). was not created by a call to . An operating system error occurs while accessing the SecureSocket. The SecureSocket has been closed. Unable to create the credentials -or- client authentication error.
public EndAccept ( IAsyncResult asyncResult ) : VirtualSocket
asyncResult IAsyncResult Stores state information for this asynchronous operation as well as any user defined data.
return VirtualSocket
		public override VirtualSocket EndAccept(IAsyncResult asyncResult) {
			// Make sure everything is in order
			if (asyncResult == null)
				throw new ArgumentNullException();
			if (m_AcceptResult == null)
				throw new InvalidOperationException();
			if (m_AcceptResult != asyncResult)
				throw new ArgumentException();
			AsyncAcceptResult ar = m_AcceptResult;
			// Process the (secure) EndAccept
			// block if the operation hasn't ended yet
            while (!ar.IsCompleted) {
                ar.AsyncWaitHandle.WaitOne(200, false);
            }
			m_AcceptResult = null;
			if (ar.AsyncException != null)
				throw ar.AsyncException;
			return ar.AcceptedSocket;
		}
		/// <summary>