Networking.Client.Disconnect C# (CSharp) Méthode

Disconnect() public méthode

Disconnects the client from the server
public Disconnect ( ) : void
Résultat void
        public void Disconnect()
        {
            if (_socket == null)
                return;
            while (_receiving) {
                Thread.Sleep(50);
            }

            _running = false;
            _socket.Shutdown(SocketShutdown.Both);
            _socket.Close();
            _socket = null;
            Disconnected?.Invoke();
        }