/// <summary> /// Cleanup resources /// </summary> /// <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (disposing && _tpsocket != null) { if (_tpsocket.Connected) { _tpsocket.Disconnect(false); } _tpsocket.Dispose(); } }
// Dispose of Socket public void Dispose() { if (_tpsocket != null) { if (_tpsocket.Connected) { _tpsocket.Disconnect(false); } _tpsocket.Dispose(); } }