I have some code which needs to know the local port it uses to connect to a server.
The Socket.localPort() call always seems to return -1. Also, do a Socket.toString() returns something like "port=33031,localport=-1" - again, with a -1.
Does anyone know why this, and how to get the local side port number? I am GNU Classpath 0.97.2 - is this just an API bug or do I not understand this call?