In vanilla .net, the Socket class has a property LocalEndPoint which provides details of the local end of the socket, including the port. In the Windows Phone 7 Socket, this property is missing.
Is there any way of getting the port number of the local end of a socket?
Update
I’m implementing a simple network protocol on WP7. The server it will be working with uses callbacks and the original request query must specify the port for the callback to be sent to (The server API does not have support for accessing details of the incoming connection, and changing this part of the code is not an option at this point). Both phone and server connect to each other over a local network.
Simple answer at the moment appears to be “No”.
If anyone knows why Microsoft don’t want you to know this, please let me know.