Sockets

Sockets
The term socket doesn't define a protocol: it has two meanings, but neither of them relates to a protocol. One meaning is the socket programming API that was created initially by the University of Berkeley for BSD UNIX. BSD sockets were adapted as a programming interface for the Windows environment (and given the name WinSock). The WinSock API is wrapped in the .NET classes of the System.Net.Sockets namespace. Windows Sockets is a protocol independent programming interface for writing networking applications.
You will discover more about socket programming in Chapters . In later chapters where we show higher-level classes for Internet programming, sockets are used behind the scenes.
The second usage of the term socket denotes an endpoint for communication between processes. In TCP/IP, an endpoint is bound to an IP address and a port number. We have to differentiate between stream and datagram socket types. A stream socket uses connection-oriented communication using the TCP/IP protocol; on the other hand the datagram socket uses connection-less communication using UDP/IP. We'll talk more about sockets in Chapter 4.