Two types of sockets are in general use: TCP sockets and UDP sockets (SOCK_STREAM and SOCK_DGRAM respectively). A “raw” socket is also available that is used for specialized applications such as “ping” and “traceroute” (tracert).
In the beginning, the network programmer had to deal with the structures in Listing 12.1 just to establish a connection.
In addition, because this was a brave new world in which different machines using different processors were not communicating, you needed to remember Network Byte Order. Remember the following?
If that was not enough, the pattern that was established for client/server applications was to use fork when a client connection was accepted on the server. In addition, when asynchronous operation was desired, the common approach was to use select. The problem that Windows programmers faced was that Windows did not have the Unix APIs of fork or select for client/server applications, so it was hard for a Windows programmer to enter the world of network programming. As an answer to this problem, Microsoft developed WinSock.
52.14.1.136