public Task DisconnectAsync() { if (_udpClient != null) { _cancelListenerSource.Cancel(); _cancelListenerSource = null; _udpClient.Dispose(); _udpClient = null; } return(Task.FromResult(default(object))); }
/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (!this.disposedValue) { if (disposing) { udpListener.Dispose(); } this.disposedValue = true; } }
public void Dispose() { replySocket.Dispose(); server.Dispose(); }
/// <inheritdoc/> public void Dispose() { _client?.Dispose(); }