Merge pull request #97 from bibendovsky/fix/fastagi_start

Clean up on socket initialization error
This commit is contained in:
Ben Merrills 2017-04-25 09:42:06 +01:00 committed by GitHub
commit 5643bab099

View file

@ -240,6 +240,20 @@ namespace AsterNET.FastAGI
#endif #endif
throw ex; throw ex;
} }
finally
{
if (serverSocket != null)
{
serverSocket.Close();
serverSocket = null;
}
pool.Shutdown();
#if LOGGER
logger.Info("AGIServer shut down.");
#endif
}
#if LOGGER #if LOGGER
logger.Info("Listening on " + address + ":" + port + "."); logger.Info("Listening on " + address + ":" + port + ".");
#endif #endif