To listen for connections on any suitable IPv4 interface, specify
the special dotted-quad address "0.0.0.0". You can accept
connections from clients using either IPv4 or IPv6 on the same socket by
specifying the special IPv6 address "::0", however this is only
supported on Windows 7 and Windows Server 2008 R2 or later platforms. If
no local address is specified, then the server will only listen for
connections from clients using IPv4. This behavior is by design for
backwards compatibility with systems that do not have an IPv6 TCP/IP
stack installed.
If the INET_OPTION_REUSEADDRESS option is not specified, an error may
be returned if a listening socket was recently created for the same
local address and port number. By default, once a listening socket is
closed there is a period of time that all applications must wait
before the address can be reused (this is called the TIME_WAIT
state). The actual amount of time depends on the operating system and
configuration parameters, but is typically two to four minutes.
Specifying this option enables an application to immediately re-use a
local address and port number that was previously in use. Note that
this does not permit more than one server to bind to the same
address.
If the INET_OPTION_EXCLUSIVE option is specified, the local address
and port number cannot be used by another process until the listening
socket is closed. This can prevent another application from forcibly
binding to the same listening address as your server. This option can
be useful in determining whether or not another process is already
bound to the address you wish to use, but it may also prevent your
server application from restarting immediately, regardless if the
INET_OPTION_REUSEADDRESS option has also been specified.
If an IPv6 address is specified as the local address, the system
must have an IPv6 stack installed and configured, otherwise the
method will fail.