About Berkeley Sockets and Winsock
A socket is a communications endpoint with a name and address in a network. Sockets were made famous by their implementation in Berkeley UNIX, and made universal by their incorporation into Windows.
Most socket-based applications employ a client-server approach to communications. Rather than trying to start two network applications simultaneously, one application tries to make itself always available (the server or the provider) while another requests services as needed (the client or the consumer).
VMCI sockets are designed to use the client-server approach but, unlike TCP sockets, they do not support multiple endpoints simultaneously initiating connections with one another.
Data going over a socket can be in any format, and travel in either direction.
Many people are confused by AF_INET as opposed to PF_INET. Linux defines them as identical. This manual uses AF only. AF means address family, while PF means protocol family. As designed, a single protocol family could support multiple address families. However as implemented, no protocol family ever supported more than one address family. For Internet Protocol version 6 (IPv6), AF_INET6 is synonymous with PF_INET6.
WinSock includes virtually all of the Berkeley sockets API, as well as additional WSA functions to cope with cooperative multitasking and the event-driven programming model of Windows.
Programmers use stream sockets for their high reliability, and datagram sockets for speed and low overhead.
Trade Press Books
Internetworking with TCP/IP, Volume 3: Client-Server Programming and Applications, Linux/Posix Sockets Version, by Douglas E. Comer and David L. Stevens, 601 pages, Prentice-Hall, 2000.
UNIX Network Programming, Volume 1: The Sockets Networking API, Third Edition, by W. Richard Stevens (RIP), Bill Fenner, and Andrew M. Rudoff, 1024 pages, Addison-Wesley, 2003.
Berkeley Sockets
Wikipedia offers an excellent overview of the history and design of Berkeley sockets.
For reference information about Berkeley sockets, locate a Linux system with manual pages installed, and type man socket. You should be able to find both socket(2) and socket(7) reference pages.
Microsoft Winsock
The Winsock Programmer’s FAQ is an excellent introduction to Windows sockets. Currently it is hosted by the http://tangentsoft.net Web site.
For complete reference information about Winsock, refer to the public MSDN Web site.