protected void CompleteAcceptAsyncResult() { lock (this) { if (beginAcceptAsyncResult != null) { beginAcceptAsyncResult.Completed(innerException); beginAcceptAsyncResult = null; innerException = null; } } }
public ElServerSSLSocket EndAccept(IAsyncResult asyncResult) { SSLSocketAsyncAcceptResult ar = (SSLSocketAsyncAcceptResult)asyncResult; ar.AsyncWaitHandle.WaitOne(); if (ar.Exception != null) { throw ar.Exception; } if (!SBSSLServer.Enabled) { ar.AcceptedSocket.OpenSSLSession(); } return(ar.AcceptedSocket); }
public IAsyncResult BeginAccept(AsyncCallback callback, object state) { if (transport == null) { throw new NullReferenceException("Set \"Socket\" property first"); } if (beginAcceptAsyncResult != null) { throw new InvalidOperationException(); } transport.Blocking = false; beginAcceptAsyncResult = new SSLSocketAsyncAcceptResult(this, callback, state); transport.BeginAccept(new AsyncCallback(OnSocketAcceptCallback), null); return(beginAcceptAsyncResult); }
private ElServerSSLSocket(SSLSocketAsyncAcceptResult ar) : base() { beginAcceptAsyncResult = ar; }