Exemple #1
0
        public Task DisconnectAsync()
        {
            if (_udpClient != null)
            {
                _cancelListenerSource.Cancel();
                _cancelListenerSource = null;
                _udpClient.Dispose();
                _udpClient = null;
            }

            return(Task.FromResult(default(object)));
        }
Exemple #2
0
        /// <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;
            }
        }
Exemple #3
0
 public void Dispose()
 {
     replySocket.Dispose();
     server.Dispose();
 }
 /// <inheritdoc/>
 public void Dispose()
 {
     _client?.Dispose();
 }