Example #1
0
 protected void CompleteAcceptAsyncResult()
 {
     lock (this)
     {
         if (beginAcceptAsyncResult != null)
         {
             beginAcceptAsyncResult.Completed(innerException);
             beginAcceptAsyncResult = null;
             innerException         = null;
         }
     }
 }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
 private ElServerSSLSocket(SSLSocketAsyncAcceptResult ar) : base()
 {
     beginAcceptAsyncResult = ar;
 }