Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to host second instance prevents closing second host terminal #18

Open
patridge opened this issue Jul 25, 2022 · 0 comments
Open

Comments

@patridge
Copy link
Contributor

If you try to host a second site while a first site is currently hosted, the second terminal will log an exception and prevent exiting the non-working host execution.

Environment

  • Windows 10
  • Chloroplast v0.5.4.0

Steps

  1. Host first site in one terminal with chloroplast host.
  2. Try to host a second site in another terminal with chloroplast host.

Expected

Either Chloroplast tries to host the site at a different address.
Or, Chloroplast shows an error and doesn't continue executing.

Actual

Chloroplast will display a Kestrel exception and stack trace.

crit: Microsoft.AspNetCore.Server.Kestrel[0]
Unable to start Kestrel.
System.IO.IOException: Failed to bind to address http://127.0.0.1:5000: address already in use.
---> Microsoft.AspNetCore.Connections.AddressInUseException: Only one usage of each socket address (protocol/network address/port) is normally permitted.
......

And then, after a short delay, it will display a message that it is waiting to end.

Waiting for the host to be disposed. Ensure all 'IHost' instances are wrapped in 'using' blocks.

At this point, the second site terminal doesn't respond to Ctrl+C.

Even stopping the first site host doesn't allow the second terminal to end, and the whole terminal session must be killed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant