0

I've seen APIs that use "*" and "::" (for IPv6) to mean "any address" (i.e. INADDR_ANY) when binding a socket. I've also seen APIs that use "" or "0.0.0.0" to mean the same. Is there a widely use standard for writing "any address" as a string?

1
  • An IPv6 socket can connect to IPv4 via address mapping, thus in6addr_any and ::0 would be preferred. Commented Feb 22, 2013 at 14:06

2 Answers 2

3

Those are the two ways. Sadly there isn't one that works for both IPv4 and IPv6. When binding a socket you should certainly use INADDR_ANY.

Sign up to request clarification or add additional context in comments.

Comments

-1

It's such a good idea, that there's more than one widely used way to write that. Isn't programming fun?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.