public bool Start()
{
if (!isRunning)
{
Thread ListenerThread = new Thread(new ThreadStart(Run));
try
{
net_Listener.Start();
}
catch (HttpListenerException)
{
return false;
}
isRunning = true;
// Set this to true, so when the program wants to terminate,
// this thread won't stop the program from exiting.
ListenerThread.IsBackground = true;
ListenerThread.Start();
return true;
}
return false;
}