protected virtual void OnDispose() { try { object data = DequeueSendMessage(); while (data != null) { if (data is IBuffer) { ((IBuffer)data).Free(); } data = DequeueSendMessage(); } mReceiveArgs.Server = null; mReceiveArgs.Session = null; mBaseNetStream.Dispose(); if (mSslStream != null) { mSslStream.Dispose(); } Server.CloseSession(this); Server = null; ReceiveDispatcher = null; if (Packet != null) { Packet.Dispose(); } mProperties.Clear(); } catch { } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (mPipeStream != null) { mPipeStream.Dispose(); mPipeStream = null; } }
public void Dispose() { if (!mIsDisposed) { Client = null; mIsDisposed = true; if (pipeStream != null) { pipeStream.Dispose(); pipeStream = null; } } }
protected virtual void OnDispose() { try { object data = DequeueSendMessage(); while (data != null) { if (data is IBuffer buffer) { BeetleX.Buffers.Buffer.Free(buffer); //((IBuffer)data).Free(); } data = DequeueSendMessage(); } if (SendEventArgs != null) { SendEventArgs.Dispose(); } if (ReceiveEventArgs != null) { ReceiveEventArgs.Dispose(); } mReceiveArgs.Server = null; mReceiveArgs.Session = null; mBaseNetStream.Dispose(); if (mSslStream != null) { mSslStream.Dispose(); } Server.CloseSession(this); Server = null; ReceiveDispatcher = null; if (Packet != null) { Packet.Dispose(); } mProperties.Clear(); if (SendBufferPool is PrivateBufferPool sendPool) { sendPool.Dispose(); } if (ReceiveBufferPool is PrivateBufferPool receivePool) { receivePool.Dispose(); } } catch { } }
protected virtual void OnDispose() { try { object data = DequeueSendMessage(); while (data != null) { if (data is IBuffer buffer) { BeetleX.Buffers.Buffer.Free(buffer); } data = DequeueSendMessage(); } SendEventArgs?.Dispose(); SendEventArgs?.Clear(); ReceiveEventArgs?.Dispose(); ReceiveEventArgs?.Clear(); mReceiveArgs.Server = null; mReceiveArgs.Session = null; mBaseNetStream.Dispose(); if (mSslStream != null) { mSslStream.Dispose(); } Server.CloseSession(this); ListenHandler = null; ReceiveDispatcher = null; if (Packet != null) { Packet.Dispose(); } ((IDisposable)Tag)?.Dispose(); OnDisposeProperties(); ((IDisposable)mToken)?.Dispose(); } catch { } finally { Tag = null; mToken = null; } }