use INADDR_ANY for increased portability #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I believe that there is a subtle portability problem in the current implementation. We would like to bind to any (i.e. all) network interfaces to ensure that all processes can reach Mango, whether they exist on localhost or are external. The correct way to do this is to use the system-defined value for
INADDR_ANY
.1 However, the current implementation assumes that this will be '0.0.0.0'. While it is certainly true that many operating systems implementINADDR_ANY
in this way, I'm worried that Mango could break in unforeseen ways on new and alternative TCP/IP stacks provided by next-generation cloud operating systems. This change should ensure the longevity of Mango by increasing the likelihood that it will be able to correctly adapt in these situations.1: See http://pubs.opengroup.org/onlinepubs/000095399/basedefs/netinet/in.h.html for details.