Beispiel #1
0
 void DoClose()
 {
     if (_socket is object && _socket.Connected)
     {
         _socket.Close();
     }
 }
Beispiel #2
0
        public override void Close()
        {
            if (_ownsSocket)
            {
                _socket.Close();
            }

            base.Close();
        }
Beispiel #3
0
        private bool disposedValue = false; // To detect redundant calls

        void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    _socket?.Close();
                    _socket?.Dispose();
                    _socket = null;
                }

                disposedValue = true;
            }
        }