Wildcard address the right to choose the port to the operating system kernel

 

For example, a machine with two network cards, IP address is 192.168.1.11 and 202.61.22.55, respectively, then the request to the request of the two IP packets are processed we write applications. So how to set up a wildcard address it?

For IPv4 address is used to complete the set INADDR_ANY wildcard address; for IPv6 addresses, the use of wildcard IN6ADDR_ANY to finish the address.

 

In addition to the address, and port. If the port is set to 0, the equivalent of the right to choose the port to the operating system kernel to handle, the operating system kernel will choose a free port according to certain algorithms, to complete the binding of a socket. This is not commonly used on the server side.

Guess you like

Origin www.cnblogs.com/yuanjiangw/p/12381449.html