- March 24, 2007
- 12,073
- 7,459
- Home Country
- Germany
- Moderator
- #11
Bad bughe issue is that when trying to subsequently stop the server it waits for the shutdownEvent to be set, but that's only ever set in the OnAccept method, which doesn't ever get called if the listener failed to start so it just waits there indefinitely.
Any suggestions for a solution? Should we set it immediately if the listener fails to start or avoid calling stop in the first place or...?
I guess the exception happens on "_listener.Start(backlog);" if the port is in use? We could add a try/catch here and do set the _shutdownEvent in catch block.
But as I understand this, even the normal shutdown procedure depends on at least one request to be accepted? So the catch in Start() would be only a partial solution.
That all remembers me that we planned to replace the quite old HttpServer part by new .NET provided server components, because there are more known issues...