Networking.Client.Disconnect C# (CSharp) 메소드

Disconnect() 공개 메소드

Disconnects the client from the server
public Disconnect ( ) : void
리턴 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();
        }