Closed gyorokpeter closed 3 years ago
Hello @gyorokpeter, thanks for using EmbedIO!
Setting 0 as a port number is already being discussed in #506. I'm therefore closing this issue as duplicate.
As for retrieving the actual port number, it sort of comes with the package: there's little to no sense in implementing it now, but it's an obvious requirement once setting port 0 is allowed.
Normally this is done by passing 0 to the TCP layer and then retrieving the listen port. However WebServer throws "Invalid port" when trying to pass in 0 as the port. There also doesn't appear to be a function to retrieve the port from WebServer.