Home > Store > Programming > .NET and Windows Programming
Windows Sockets Network Programming
- By Bob Quinn, David Shute
- Published Dec 4, 1995 by Addison-Wesley Professional. Part of the Addison-Wesley Advanced Windows Series series.
- Copyright 1996
- Dimensions: 7-3/8x9-1/4
- Pages: 656
- Edition: 1st
- Book
- ISBN-10: 0-201-63372-8
- ISBN-13: 978-0-201-63372-6
Register your product to gain access to bonus material or receive a coupon.
Windows Sockets (WinSock), a standard network API co-developed by PC network industry leaders including Microsoft, Novell, Hewlett-Packard, and FTP Software, is an extraordinary resource for Windows network programmers. This book will enable you to reap WinSock's full benefits to create client and server network applications for use on any TCP/IP network, including the Internet. It also lays the groundwork for WinSock application development using other protocol suites.
The book describes how to develop 16- and 32-bit WinSock applications, and focuses on designs that will run on any WinSock implementation. It highlights the differences that exist between WinSock DLLs, and other traps and pitfalls in network application development, and shows you how to avoid them. It covers every function in version 1.1 of the WinSock specification, and provides a detailed tour of the newest features in WinSock version 2.
Windows Sockets Network Programming is geared for novice and experienced network programmers alike. The early chapters provide a tutorial that brings novices up to speed quickly, and the remainder provides a detailed reference, with examples. These include complete source code for a number of useful applications, including an ftp client. Other topics covered include: how to create a dynamic link library to run over WinSock, how to port existing BSD Sockets source code to WinSock, and how/when to use WinSock's optional features. It also details debugging techniques and tools.
The appendices provide a quick reference for API essentials, illustrations of the TCP/IP protocol suite, an extensive error reference, and pointers to more information on or off the Internet. The accompanying disk contains the source code for all the sample applications, as well as a few other tools to help you with your programming tasks.
0201633728B04062001
CD Contents
|
24 of 25 people found the following review helpful
By A Customer
This review is from: Windows Sockets Network Programming (Paperback)
If you are proficient in C and/or C++, and you would like to begin network programming, this book is for you! I found it so easy to learn from this book, that I wrote a simple chat server and client after about a week! I would highly recommend this book to anyone wanting to increase their programming power to access the world wide web with their programs.
22 of 23 people found the following review helpful
By A Customer
This review is from: Windows Sockets Network Programming (Paperback)
This book is great! I am a VB developer who has been using this book to write some HTTP software, and this book has taught me all the theory I could ever want. This, combined with Microsoft's API documentation and a few good examples here and there, have allowed me to build the applications I needed and, more importantly, how to debug them. The organization of the book is not super intuitive; you really need to read the _whole_ book before trying to use anything out of it. In the first or second chapter, the author presents a "quick and dirty" description of how everything works. If you try to read only this chapter and start coding, you will slit your wrists. There's a lot of additional stuff (like WSAStartup, for example) that you won't cover until chapter four or so. However, once you've read the whole thing, it all makes perfect sense!
16 of 17 people found the following review helpful
By GatoRat (United States) - See all my reviews
This review is from: Windows Sockets Network Programming (Paperback)
While this book has a lot of good information, it is out dated, sometimes wildly so. It continually hampers itself with discussions of 16-bit Windows which, while still in use in 1995/1996, was clearly on the way out, contrary to what the writers assert in the first chapter. Having said that, it is well written and the book deserves a second edition, dedicated to Winsock2 with nary a word on 16-bit windows.
|
› See all 30 customer reviews...
Praise For Windows Sockets Network Programming
"WinSock has become hugely popular and has been badly in need of a great book. Until now (Windows Sockets Network Programming)."
Preface
This book describes the Windows Sockets application programming interface (API), commonly known as "WinSock." This is intended to be a companion to the v1.1 Windows Sockets specification, not a replacement for it. The contents provide a roadmap for the specification, an orientation resource. The book describes and illustrates every aspect of the Windows Sockets specification, from top to bottom. It deals with optional features as well as many features in version 2.0 of the Windows Sockets specification.
The key focus of the text is to provide a "how to" guide for writing supportable and extensible network applications that will run efficiently over all Windows Sockets implementations. One of the most frustrating things to hear is, "It's impossible to write anything more than a basic 'hello world' that will execute over all Winsock implementations." This simply is not true. More often than not, when an application runs on one WinSock and fails on another, it is because the application developers made some incorrect assumptions. They assumed that WinSock could do something that the specification did not explicitly warrant. In other words, it may not have been the fault of the WinSock implementor, nor of the WinSock specification. You can avoid this type of application failure, and we show you how.
This book is for anyone who wants to know how to write a successful WinSock application. If you are writing a program from scratch, porting an existing one from Berkeley sockets (or any other network API), writing a network DLL, or just updating an application that someone else wrote, then this book is for you. We deal with both 16-bit Windows platforms (Microsoft Windows 3.1 and Windows for Workgroups) and 32-bit platforms (Windows NT 3.1 and 3.5, and Windows 95). We also describe the other platforms that support the WinSock API: Platforms with Windows are adding Sockets.
Organization
The first half of the book contains a tutorial for network programming. We do not make any assumptions about what you already know. The second half is intended to be an in-depth reference, with detailed explanations and code examples. The appendices provide a quick reference.After we describe Windows Sockets in general terms in Chapter 1, we provide an overview of network software architectures in Chapter 2. In Chapter 3 we describe the protocols in the TCP/IP suite, with a focus on the services available to your network applications, and some of their pros and cons. We begin to provide some details about the WinSock programming interface in Chapter 4, as we describe the framework for all network applications in terms of the fundamental network function calls. Chapter 5 covers the different operation modes available, and Chapter 6 discusses the state machine implicit in every network application. That essentially ends the tutorial.
In Chapter 7 we present the source code for our largest application, an FTP client. Chapters 8, 9, and 10 are a catalog of detailed descriptions of all the WinSock function calls we have not discussed up to this point. Chapter 11 deals with the specifics of creating a dynamic link library to run over a WinSock DLL. Chapter 12 describes the issues and strategies involved with porting existing BSD Sockets source code to 16-bit and/or 32-bit Windows.
We start to wrap things up and tie up loose ends in Chapter 13, which details WinSock application debugging techniques and tools. Chapter 14 provides general advice and many specifics about traps and pitfalls to avoid in your WinSock applications. Chapter 15 describes the many different operating-system platforms that currently provide the WinSock API. Chapter 16 covers the optional features - some intentional, and some not - in the WinSock specification and tells you when and how to use them. Finally, Chapter 17 provides a detailed tour of all the new features in version 2.0 of the WinSock specification.
In Appendix A, we have illustrations and short descriptions of the headers for protocols in the Internet suite (TCP/IP). Appendix B contains a quick reference for the entire WinSock API, including its functions, structures, and macros (including some that were forgotten). Appendix C provides a detailed WinSock error reference. Appendix D contains some mechanical details for compiling and linking applications, and Appendix E has network and bibliographical information sources.
Audience
Although we do not assume any prior knowledge of networks, protocols, or network programming with sockets or any other network API, it does not hurt to have some. This book is for novice and experienced network application developers alike. This text also includes extensive background and illustrative information not found in the v1.1 Windows Sockets specification, so even the most advanced WinSock application developer can benefit from reading it.We do assume a knowledge of the C programming language and Microsoft Windows APIs (WinAPI or Win32).
Sample Applications
The sample applications in this book were created with Microsoft C version 1.51 (16-bit) and Microsoft C version 2.0 (32-bit). They are also compatible with Borland C version 4.0. Makefiles that support these platforms accompany the source code. The applications have been tested on almost all of the commercial and shareware versions of WinSock available, over Ethernet and PPP (point-to-point protocol), using both local and distant connections. If you find any problems with these applications, we'd like to hear about them. Please e-mail problem reports to bugs@sockets.com.You can retrieve updates to these sample applications via the Internet: http://www.sockets.com.
Acknowledgments
Many thanks to people for their help and participation in making this book possible. Thanks especially to the reader, who is the very reason for this book. May your Windows Sockets applications be great ones.Thanks most of all to Bob Quinn. He wanted to give birth to this book; I only provided the hot water, towels, antiseptic, blankets, silver nitrate, topical anesthesia, and appropriate words.
Dave Shute
dks@world.std.com
Reading, MA
May 1995
There are far too many people that have helped in this endeavor for any acknowledgment list to do justice. Nonetheless, I want to mention a few people in particular. First and foremost, for their implicit contribution, is my family. It will be nice to spend time with them again. Second is my cowriter and friend, Dave Shute, whose red pencil is as pricelessly sharp as his wit.
I'm indebted to Larry Backman, Mike Khalandovsky, and John Keller at FTP Software, Inc., for their support and encouragement. Dave Barnard, Kerry Hannigan, and Helen Sylvester - FTP Software's crack SDK support staff - deserve a special note for their constant stream of challenges that did more to teach me about how to program - and how not to program - WinSock apps than anything else did.
My coadministrators in the WinSock 2.0 specification clarification functionality group, Paul Brooks and Vikas Garg, deserve a lot of credit for their untiring efforts to shed light into the dark corners of WinSock. In addition to clarifying many things in the spec, they also clarified some things in this book.
Other reviewers of note: Jim DeMarco, Fred Whiteside, Dave Andersen, Charlie Tai, Alun Jones, Eli Patashnik, and our consulting editor, Alan Feuer.
Thanks to the kind folks at Addison-Wesley: John Wait, Mike Hendrickson, Kim Dawley, Marty Rabinowitz, Simone Payment, and Katie Duffy.
Lastly, I want to thank Martin Hall for having initiated the Windows Sockets effort and his coauthors and contributors for helping him carry it through. The sure sign of a good idea is one that makes you think, "Why didn't I think of that!?" That's WinSock. It was a great idea, and its immediate success has confirmed this obvious fact.
Bob Quinn
rcq@ftp.com.
Weston, Massachusetts
May 1995
0201633728P04062001
Table of Contents
Foreword.
Preface.
1. Introduction to Windows Sockets.
2. Windows Sockets Concepts.
3. TCP/IP Protocol Services.
4. Network Application Mechanics.
5. Operation Modes.
6. Socket States.
7. Sample Application and Library.
8. Host Names and Addresses.
9. Socket Information and Control.
10. Support Routines.
11. DLLs over WinSock.
12. Porting from BSD Sockets.
13. Debugging.
14. Dos and Don'ts.
15. Platforms.
16. Optional Features.
17. WinSock 2.
Appendix A. TCP/IP Protocol Headers.
Appendix B. Quick Reference.
Appendix C. Error Reference.
Appendix D. What You Need.
Appendix E. Information Sources.
Index. 0201633728T04062001
Errata
Click below for Errata related to this title:
Updates
Book
This product currently is not for sale.
Related Products
Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.




