UPDATED: By "available port" I mean: the OS can pick any available port i.e. I do not want to specify a port.
Question 1: Use port number 0
Question 2: Use acceptor.local_endpoint().port()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With