I need to setup two ServerSockets in my application.
One is to send the data, and the other is to send the "cross-domain-poloicy file (a sort of XML for falsh security)".
They use distinct port (e.g. the first 5150 and the second 843 or 5151).
It's fairly straightforward, e.g.
ServerSocket socket2(5151); // ServerSocket socket2(843);
However, when the second server socket tries to bind, it always fail.
int rc = ::bind(_sockfd, address.addr(), address.length());
::bind always returns -1.
How can I solve this problem?
I'm struggling with this problem for three days.
PS: I examined the test code TCPServerTest, where multiple connections all share the same port.