Stop GT server from eating CPU.

This commit is contained in:
Greg Edwards 2014-07-01 18:07:24 -04:00
parent 4f8376ec3e
commit ddfeebbd40
2 changed files with 4 additions and 3 deletions

View File

@ -96,13 +96,13 @@ namespace PkmnFoundations.GlobalTerminalService
{
if (!m_listener.Pending())
{
Thread.Sleep(5);
Thread.Sleep(10);
continue;
}
Stream s = AcceptRequest();
if (s == null)
{
Thread.Sleep(5);
Thread.Sleep(10);
continue;
}

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
namespace PkmnFoundations.GlobalTerminalService
{
@ -16,7 +17,7 @@ namespace PkmnFoundations.GlobalTerminalService
#if DEBUG
Service1 myService = new Service1();
myService.Start();
while (true) { }
while (true) { Thread.Sleep(1000); }
#else
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]