Community
Participate
Working Groups
The code in Socket::listen iterates over each of the addresses returned by getaddrinfo and calls bind on each, regardless of whether the bind is successful or not. The subsequent call to listen is then only made on the socket for the last address. In situations where there are multiple addresses (e.g. IPv4 and IPv6), this code will leave sockets bound to ports that are never used, and because listen hasn't been called, in a half created state. The implementor should decide how to handle this situation correctly.
For this issue, we have used an array to save the usable multiple addresses. In each iteration, if the socket can be binded and listened successfully, we will save it into the array "accSockets[accCount] = sockfd;", and then do "accCount++;" to make sure the "accCount" records the correct number of usable socket. All the usable addresses can be used. We have already committed the changes, pls try the latest version of SCI codes. This issue should have been fixed.
Yes, there was this problem but got fixed.
Closing as fixed.