private void Exit(object sender, EventArgs args) { Task.Run(async() => { await socket.Exit(); }).Wait(); }
public async Task Exit() { exit = true; await updateTask; if (!startGame) { await socket.Exit(); } else { socket.ReceivedOk -= OnReceiveOk; socket.AnotherJoinRoom -= OnAnotherJoinedRoom; } }