This article describes the terms "Port" and "Address" used in Windows Sockets ". Port
A port identifies a unique process. A process can have a service. In the current context, the port is associated with an application that supports Windows Sockets. The reason for association is to uniquely identify each Windows Sockets application so that multiple Windows Sockets applications can run simultaneously on one computer.
Some ports are reserved for public services (such as FTP. Do not use these ports unless you are providing such public services. The Windows Sockets specification details these reserved ports. The WINSOCK. H file also lists these ports.
If you want Windows Sockets DLL to select an available port for you, pass 0 as the port value. MFC selects a port value greater than the decimal number 1,024. You can call the CAsyncSocket: GetSockName member function to retrieve the port value selected by MFC. Socket address
Each socket object is associated with an Internet Protocol (IP) address on the network. This address is usually a computer name, such as "ftp.microsoft.com", or a number separated by dots, such as "128.56.22.8 ".
When you are seeking to create a socket, you do not need to specify your own address.
Note:A computer may have multiple NICs (or applications may run on such computers one day), and each Nic represents a different network. In this case, you may need to provide an address to specify which Nic the socket will use. This will inevitably become an advanced usage and may cause portability problems.