using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void Update() {
if (Input.GetKey("escape"))
Application.Quit();
}
}
Do that, export your app, press space… it should work
Try to make sure you close the socket connection and do some cleanup before calling Application.Quit().
I can’t be sure but it looks like you are calling Application.Quit() from a worker thread, calling unity functions from other threads simply doesn’t work.