Overview
Features
Download
Documentation
Community
Add-Ons & Services

Error in binding second ServerSocket in Two ServerSockets

A general discussion forum.

Error in binding second ServerSocket in Two ServerSockets

Postby coolcat » 23 Jan 2013, 04:16

Hi,

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 socket1(5150);
ServerSocket socket2(5151); // ServerSocket socket2(843);

However, when the second server socket tries to bind, it always fail.
In particular,

in SocketImple::bind()
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.
coolcat
 
Posts: 2
Joined: 23 Jan 2013, 04:05

Re: Error in binding second ServerSocket in Two ServerSocket

Postby coolcat » 23 Jan 2013, 11:35

It's my mistake.
Both port 843 and 5151 was not allowed for general use.
coolcat
 
Posts: 2
Joined: 23 Jan 2013, 04:05


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron