Пример #1
0
        private void Dispose(bool disposing)
        {
            disposed = true;

            if (disposing)
            {
                if (disposed || Interlocked.CompareExchange(ref in_progress, 0, 0) != 0)
                {
                    return;
                }
#if !SSHARP
                if (Worker != null)
                {
                    Worker.Dispose();
                    Worker = null;
                }
#endif
            }
            AcceptSocket   = null;
            Buffer         = null;
            BufferList     = null;
            RemoteEndPoint = null;
            UserToken      = null;
#if !NET_2_1
            SendPacketsElements = null;
#endif
        }
Пример #2
0
        public SocketAsyncEventArgs()
        {
#if !SSHARP
            Worker = new Socket.Worker(this);
#endif
            AcceptSocket          = null;
            Buffer                = null;
            BufferList            = null;
            BytesTransferred      = 0;
            Count                 = 0;
            DisconnectReuseSocket = false;
            LastOperation         = SocketAsyncOperation.None;
            Offset                = 0;
            RemoteEndPoint        = null;
#if !NET_2_1
            SendPacketsElements = null;
            SendPacketsFlags    = TransmitFileOptions.UseDefaultWorkerThread;
#endif
            SendPacketsSendSize = -1;
            SocketError         = SocketError.Success;
            SocketFlags         = SocketFlags.None;
            UserToken           = null;
        }