Sorry for all the pull requests, but here is another feature/bug fix.
Using AsyncTCPListener and AsyncUDPSocket if you've used 0 as the port local() will always return port 0.
When you bind on port 0 the OS will pick one for you. After which you need to call getsockname to ask the OS which port was assigned. I didn't see an easy we to do this with out modifying the library. I figured after the run call there wasn't any problem with asking the os to just update m_local weather or not port 0 was used. Although I think the only time getsockname will return something different than what you passed to bind is if port 0 was used.
Sorry for all the pull requests, but here is another feature/bug fix.
Using AsyncTCPListener and AsyncUDPSocket if you've used 0 as the port local() will always return port 0. When you bind on port 0 the OS will pick one for you. After which you need to call getsockname to ask the OS which port was assigned. I didn't see an easy we to do this with out modifying the library. I figured after the run call there wasn't any problem with asking the os to just update m_local weather or not port 0 was used. Although I think the only time getsockname will return something different than what you passed to bind is if port 0 was used.