1 Networking and Network Programming 2 TCP/IP Overview 3 WinSock Overview 4 Visual C++
I
Chapter 1 s
Networking and Network Programming
3
1
Networking Networking and Network and Network Programming Programming
4
Part I s
Introduction to Networking
The purpose of this book is to show you how to make network-aware applications that run on the Microsoft Windows and Windows NT operating systems using the Windows Sockets (WinSock) Application Programming Interface (API). To that end, several practical examples are examined that utilize the basic functionality of WinSock. Network operating systems, such as Windows for Workgroups and Windows NT, provide basic file and printer sharing services. This most basic level of functionality is provided “out of the box.” Network-aware applications are programs that use the capabilities of a collection of connected computers. Network-aware programs range from custom applications that transfer data among computers on a network to mainstream applications that enable electronic mail and remote database access. The WinSock API is a library of functions that a programmer can use to build these network-aware applications. WinSock has its roots in Berkeley sockets as introduced in the Berkeley Software Distribution of UNIX. WinSock uses the TCP/IP (Transmission Control Protocol/Internet Protocol) suite, which provides the formal rules of behavior that govern network communications between all computers running this particular computer networking protocol. Before I begin the examination of network programming, look at the basics of computer networking in general. A network can be loosely defined as a collection of two or more computers that have some sort of communication path between them. A network can be loosely classified as either a local area network (LAN) or wide-area network (WAN). The use of the terms LAN and WAN is somewhat misleading because which term you use is relative