protected override void OnDisposing(bool disposeManagedObjects) { if (disposeManagedObjects) { PacketReceived = null; PacketSent = null; ErrorOccurred = null; Reader.Dispose(); Writer.Dispose(); Packets.Dispose(); } }