Ejemplo n.º 1
0
        protected void CompleteReceiveAsyncResult()
        {
#if SECURE_BLACKBOX_DEBUG
            LowLevelDump("ElSSLSocket.CompleteReceiveAsyncResult() {}");
#endif
            lock (this)
            {
                SSLSocketAsyncResult res = beginReceiveAsyncResult;
                if (res != null)
                {
                    beginReceiveAsyncResult = null;
                    res.Completed(innerException);
                    res            = null;
                    innerException = null;
                }
                else if (beginConnectAsyncResult != null)
                {
                    res = beginConnectAsyncResult;
                    beginConnectAsyncResult = null;
                    res.Completed(innerException);
                    res            = null;
                    innerException = null;
                }
                else if (beginOpenSSLSessionAsyncResult != null)
                {
                    res = beginOpenSSLSessionAsyncResult;
                    beginOpenSSLSessionAsyncResult = null;
                    res.Completed(innerException);
                    res            = null;
                    innerException = null;
                }
            }
        }
Ejemplo n.º 2
0
        protected void SetOpenSSLSessionAsyncResult(SSLSocketAsyncResult ar)
        {
#if SECURE_BLACKBOX_DEBUG
            LowLevelDump("ElSSLSocket.SetOpenSSLSessionAsyncResult() {}");
#endif
            lock (this)
            {
                beginOpenSSLSessionAsyncResult = ar;
            }
        }
Ejemplo n.º 3
0
        public void EndOpenSSLSession(IAsyncResult asyncResult)
        {
#if SECURE_BLACKBOX_DEBUG
            LowLevelDump("ElSSLSocket.EndOpenSSLSession() {}");
#endif
            SSLSocketAsyncResult ar = (SSLSocketAsyncResult)asyncResult;
            ar.AsyncWaitHandle.WaitOne();
            if (ar.Exception != null)
            {
                throw ar.Exception;
            }
        }
Ejemplo n.º 4
0
        protected virtual void InnerEndConnect(IAsyncResult asyncResult)
        {
#if SECURE_BLACKBOX_DEBUG
            LowLevelDump("ElSSLSocket.InnerEndConnect() {}");
#endif
            SSLSocketAsyncResult ar = (SSLSocketAsyncResult)asyncResult;
            ar.AsyncWaitHandle.WaitOne();
            if (ar.Exception != null)
            {
                throw ar.Exception;
            }
        }
Ejemplo n.º 5
0
        protected void CompleteOpenSSLSessionAsyncResult()
        {
#if SECURE_BLACKBOX_DEBUG
            LowLevelDump("ElSSLSocket.CompleteOpenSSLSessionAsyncResult() {}");
#endif
            lock (this)
            {
                if (beginOpenSSLSessionAsyncResult != null)
                {
                    beginOpenSSLSessionAsyncResult.Completed(innerException);
                    beginOpenSSLSessionAsyncResult = null;
                    innerException = null;
                }
            }
        }
Ejemplo n.º 6
0
        virtual protected void Reset()
        {
#if SECURE_BLACKBOX_DEBUG
            LowLevelDump("ElSSLSocket.Reset() {");
#endif
            lock (this)
            {
                innerException              = null;
                opened                      = false;
                closed                      = false;
                inBufferDataPresent         = false;
                inBufferIndex               = 0;
                transportBeginReceiveCalled = false;

                beginConnectAsyncResult = null;
                beginSendAsyncResult    = null;
                beginReceiveAsyncResult = null;
            }
#if SECURE_BLACKBOX_DEBUG
            LowLevelDump("ElSSLSocket.Reset() }");
#endif
        }