I'm trying to figure out how the Android OS assigns ports via the ServerSocket constructor.
(Link: http://developer.android.com/reference/java/net/ServerSocket.html)
Specifically, using the 2nd constructor, the documentation claims that "If port == 0, a port will be assigned by the OS." Does anyone know how this port is assigned by the Android OS? Based on running a significant amount of netstat -a commands on the Android terminal, it appears to be a random selection.
Can anyone confirm this? I'd like to know what I can expect when a 0 is entered for this parameter.
Thanks in advance!