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>