📄 w32np.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><html lang="en"><head><title>Winsock Programmer's FAQ: Reviews</title><link rel="Stylesheet" type="text/css" href="../faq.css"></head><body bgcolor="#ffffee" text="#000000" link="#491e00" vlink="#7d2e01" alink="#da7417"><!-- ---- Header Bar ---- --><table border="0" width="95%" bgcolor="#006000" cellpadding="5" cellspacing="3" align="center"> <tr> <td align="left" bgcolor="#e0e0c0"> <font size="2" face=Verdana,Arial,Helvetica> <b><a href="../reviews/npwindows.html"><<</a></b> </font> </td> <td align="center"> <font face=Verdana,Arial,Helvetica color="#ffffee"> <p align=center class=bigger3><b> Winsock Programmer's FAQ<br> Section 8: Reviews<br> </b></p> </font> </td> <td align="right" bgcolor="#e0e0c0"> <font size="2" face=Verdana,Arial,Helvetica> <b><a href="../reviews/ws20.html">>></a></b> </font> </td> </tr></table><!-- ---- Body Table ---- --><table width="95%" border="0" cellpadding="10"> <tr valign="top"> <td><img src="bitmaps/w32np-cover.jpg" width=172 height=210 alt="cover image" align=right><h3><i>Win32 Network Programming</i></h3><p class=inset>by Ralph Davis<br>Addison-Wesley Developer's Press, September 1996<br>820 pp., with source code on 3.5" disk<br>ISBN 0-201-48930-9<br>$44.95 list,<a href="http://www.amazon.com/exec/obidos/ASIN/0201489309/winsockprogramme"> $35.96 at Amazon.com (click to purchase)</a><br></p><p class=inset>Book reviewed 9/7/1998</p><br clear=all><p><img src="../bitmaps/dot-clear.gif" alt="" width=1 height=1></p><p>This book would be a "shovelware" book, if it wasn't so darnedgood. You know the kind I mean: they cover twenty loosely-related topicsin as many chapters, are at least 1.5 inches thick, have at least threecoauthors who apparently only met once in a bar, and <i>always</i>include a CD-ROM, packed with many, many megabytes of things that haveonly a tenuous tie to the contents of the book. They never seem to comefrom Addison-Wesley, though, and this book doesn't mar that record.</p><p>In a way, this is the book that JeffreyRichter could have written instead of the classic<i><a href="http://www.amazon.com/exec/obidos/ASIN/1572319968/winsockprogramme"> Programming Applications for Microsoft Windows</a></i> (neé <i>Advanced Windows</i>), if he was more inclined towrite about networking. Like that must-have book, Davis' tome is big andeclectic. They even cover some of the same topics: exception handling,memory management, threading, synchronization, file I/O, DLLs, etc. Whatin the world do those things have to do with network programming? Well,it makes more sense if you think of this book as a kind of story. It'sthe story of a programmer with minimal Win32 skills who eventuallybecomes a master of the wild array of Microsoft networking APIs. Thatprogrammer could be you.</p><p>Another way to look at this book is as a "brain dump" (like a Unixcore dump, only for humans) of a master Windows network programmer. So, itincludes not only a networking tutorial, it covers all of the lower-levelAPIs that you will need to use the networking APIs effectively. Forexample, an understanding of Win32 file I/O is very helpful if you planon using Winsock 2's overlapped I/O mechanisms. Similarly, a knowledgeof threading and synchronization is essential for writing efficientnetwork servers.</p><p>Of all this, I think that the shining gem adorning this book'swell-earned crown is the book's class library. Most Winsock books don'teven acknowledge C++, and those that do seem to develop relatively weakclass libraries, or use the <shudder> Microsoft wrapper clases. Thatwasn't good enough for Davis, who developed an extensive class library,and uses it entirely throughout his book. It is good enough for bothcommercial development, and as an "idea mine," from which you canextract the raw ideas you'll need if you like to develop your own classlibraries. This is a true class library, and not a CAsyncSocket-esquecollection of wrappers. For example, in the File I/O chapter, Davisdevelops a COverlapped class, which he later uses as a parent class forhis named pipes and Winsock classes.</p><p>Hidden away in the last part of the last chapter is a wonderfulbenchmarking program that pits synchronous Winsock, overlapped Winsock,CAsyncSocket, CSocket, UDP, named pipes, and RPC against each other. Withit, you can find out which mechanism really is the fastest. Each ofthese methods has its advantages and disadvantages, of course, so youalso have to weigh those against your particular situation, but runningthis little wonder on your system might well give you that last bit ofinformation you need to decide on an appropriate architecture for yournext networking project.</p><p>In addition to topics enumerated above, this book also coversmailslots, RPC, the LAN Manager API, Windows NT's security API, theregistry, and a number of other, lesser APIs. In a sense, this book is akind of cook book, and a good, quality one at that. You'll want to haveit on hand on the theory that it will have some ideas you can use later,not because it will solve something for you right now. On the other hand,if you don't yet know how to "cook," you'll want to look elsewhere.</p><p>Note that the book's release date puts it just barely after the WindowsNT 4.0 release, and just barely before the Winsock 2.0 release. Itseems to carry its age well, but it's possible that there are a fewminor pitfalls that I did not discover. But, like many other books I'vereviewed here, this book hasn't yet been replaced by something newerthat is also better.</p><h4>The Bottom Line</h4><p>The actual Winsock coverage in this book is good and clear, but therest of the book crowds it into a single 140-page chapter. Still, I as Ihinted above, if you are just getting into serious Win32 programming andwant to focus on networking, you might pick up this volume and Richter's<i>Programming Applications for Microsoft Windows</i>. They would makea great core for a budding Win32 library.</p><h4>Related Resources</h4><p>There are several reviews of this book at<a href="http://www.amazon.com/exec/obidos/ASIN/0201489309/winsockprogramme"> Amazon.com</a>.</p><p><a href="http://www.awl.com/cseng/titles/0-201-48930-9/">Addison-Wesley</a> also has a page dedicated to this book.</p> </td> </tr></table><!-- ---- Document Footer ---- --><hr noshade size=1 color=#404040><table cellpadding=5 cellspacing=0 border=0 width=95% align=center> <tr> <td align=left> <a href="../reviews/npwindows.html"><< Network Programming for Microsoft Windows</a> </td> <td align=right> <a href="../reviews/ws20.html">Winsock 2.0 >></a> </td> </tr> <tr> <td align=left> <i>Last modified on 29 April 2000 at 15:52 UTC-7</i> </td> <td align=right> <font size=-1>Please send corrections to <a href="mailto:tangent@cyberport.com">tangent@cyberport.com</a>.</font> </td> </tr> </table> <table cellpadding=5 cellspacing=0 border=0 width=95% align=center> <tr> <td align=left width=33%> <font size=-1> <a href="../index.html"><b><</b> Go to the main FAQ page</a> </font> </td> <td width=33%> <font size=-1> <center> <a href="http://www.cyberport.com/~tangent/programming"><b><<</b> Go to my Programming pages</a> </center> </font> </td> <td align=right width=33%> <font size=-1> <a href="http://www.cyberport.com/~tangent/"><b><<<</b> Go to my Home Page</a> </font> </td> </tr> </table> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -