private void Main_Load(object sender, EventArgs e) { updateUIMethod = new DelegateUpdateUIMethod(UpdateUI); TimerCallback timerGetPlayerDataDelegate = new TimerCallback(GetPlayerData); timerGetPlayerData = new System.Threading.Timer(timerGetPlayerDataDelegate, null, 0, Timeout.Infinite); // Call the timer once. // Accepts only 1 connection. For multi-thread refer to: http://stackoverflow.com/questions/4672010/multi-threading-with-net-httplistener. clientServer.Prefixes.Add("http://localhost:1337/"); clientServer.Start(); clientServer.BeginGetContext(new AsyncCallback(ClientServerGetContext), clientServer); }