It must be a feature only of Unix(-like) systems, then. I'm working in a Windows XP environment and just tried it out with our c++ server and instead of picking a random port it actually connected to port number 0.
Updated: No, it works as described in the previous post. Our server is just reporting (incorrectly) that it is connected to port 0.
--DrWhy
"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."
| [reply] |
No, it works on Windows XP as well. bind() is what typically assigns the port number. But this has become quite off topic. There are lots of choices for networking APIs to use in Windows XP from C++, so you should probably consult the documentation for whichever one you are using.
| [reply] |