OpenSSL.SSL.SslStreamBase.EndHandshake C# (CSharp) Метод

EndHandshake() приватный Метод

private EndHandshake ( IAsyncResult asyncResult ) : void
asyncResult IAsyncResult
Результат void
		private void EndHandshake(IAsyncResult asyncResult)
		{
			InternalAsyncResult handshakeAsyncResult = asyncResult as InternalAsyncResult;
			InternalAsyncResult readwriteAsyncResult = asyncResult.AsyncState as InternalAsyncResult;

			if (!handshakeAsyncResult.IsCompleted)
			{
				handshakeAsyncResult.AsyncWaitHandle.WaitOne(WaitTimeOut, false);
			}
			if (handshakeAsyncResult.CompletedWithError)
			{
				// if there's a handshake error, pass it to the read asyncresult instance
				readwriteAsyncResult.SetComplete(handshakeAsyncResult.AsyncException);
				return;
			}
			if (readwriteAsyncResult.ContinueAfterHandshake)
			{
				// We should continue the read/write operation since the handshake is complete
				if (readwriteAsyncResult.IsWriteOperation)
				{
					InternalBeginWrite(readwriteAsyncResult);
				}
				else
				{
					InternalBeginRead(readwriteAsyncResult);
				}
			}
			else
			{
				// If we aren't continuing, we're done
				readwriteAsyncResult.SetComplete();
			}
		}