⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 general.html

📁 SDK FAQ集
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><html lang="en"><head><title>Winsock Programmer's FAQ: General Winsock Information</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="intro.html">&lt;&lt;</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 1: General Winsock Information<br>				</b></p>			</font>			</td>		<td align="right" bgcolor="#e0e0c0">			<font size="2" face=Verdana,Arial,Helvetica>				<b><a href="newbie.html">&gt;&gt;</a></b>			</font>		</td>	</tr></table><!--  ---- Body Table ----  --><table width="95%" border="0" cellpadding="10">	<tr valign="top">		<td><a name="what"></a><h5>1.1 - What is Winsock?</h5><p>The Windows Sockets (abbreviated "Winsock" or "WinSock")specification defines a network programming interface for MicrosoftWindows which is based on the "socket" paradigm popularized in <ahref=glossary.html#BSD>BSD Unix</a>. It encompasses both familiarBerkeley socket style routines and a set of Windows-specific extensions:<ol><li>Winsock 1 apps can ask Winsock to send notifications in windowmessages. This allows your program to handle both the network, UI issues,and background processing without having to worry about concurrency.<li>Winsock 2 adds many features. <a href="#ws2additions">See below</a>for details.</ol><p>Winsock 2.x defines two interfaces: an application programminginterface (API) which shields application developers from underlyinglayers, and a service provider interface (SPI) which allows transparentextensions to a Winsock stack. Through proper use of the API, a Winsockapplication can work over various network transport protocols and Winsock implementations.</p><p>(By the way, most people just say "Winsock 2" when speaking of thecurrent version of Winsock, because the newer versions just containedits and clarifications to the original spec.)</p><p>You should get a copy of the API specificationif you plan on programming for Winsock. <ahref="http://www.sockets.com/winsock2.htm#Docs">Winsock 2</a> and <ahref="ftp://ftp.stardust.com/pub/winsock/version1/docs/spec/">Winsock1.1</a> specs are available.</p><a name="version"></a><h5>1.2 - What is the latest version?</h5><p>The latest version (as of 1998.09.19) is 2.2.2, but mostWindows 95 machines are still running Winsock 1.1. There is an <ahref="#ws2">upgrade</a> available for Windows 95, however. Windows 98,Windows NT 4.0 and Windows 2000 include Winsock 2. Older OSes (NT 3.xand Windows 3.x) cannot support Winsock 2.</p><a name="ws2additions"></a><h5>1.3 - What does Winsock 2 have that Winsock 1.1 doesn't?</h5><p>One of the most important new features is official support for multipletransport protocols. Although Winsock 1.1 was not actually limited toTCP/IP, that was the only protocol that had official support writteninto the spec. There was no standard way for a vendor to add supportfor another transport protocol, though a few vendors did do proprietaryimplementations of other protocols. With Winsock 2, official support forOSI, Novell IPX/SPX and Digital's DECNet exists in the spec, and it'snow possible to add support for other protocols in a standard way. Moreimportantly, a program can be written to be transport-independent,so that it works with all of these protocols, without change.</p><p>Winsock 2 also adds support for technical initiatives like<i>quality of service</i> (QoS) and <i>multicasting</i>. Thesetechnologies will become increasingly important as bandwidth requirementsbecome more regimented and intense. For example, QoS allows avideoconferencing program to reserve a certain amount of bandwidth sothat a sudden file transfer, for example, doesn't cause its video tobegin breaking up due to a lack of bandwidth. Multicasting allows thatvideoconferencing application to send audio and video streams tomany participants without duplicating data any more than absolutelynecessary.</p><p>Another important feature of Winsock 2 is complete integrationwith Win32's unified I/O mechanisms. For example, it is possibleto use the Win32 <code>ReadFile()</code> API on a socket instead of<code>recv()</code>. More importantly, Windows NT/2000's overlapped I/Omechanisms can now be used with sockets. Winsock 2 on Windows 9x alsoimplements overlapped I/O with sockets, but because there is no nativesupport in the Windows 9x kernel for overlapped I/O, the mechanism iscompletely emulated by Winsock.</p><p>Winsock 2 also allows for "Layered Service Providers." This enablesmany neat things, such as security plug-ins: drop in, say, an SSL serviceprovider, and all of a sudden your data is automatically encrypted.</p><p>There are a number of other additions to thespec. You can get a complete list of them on sockets.com's <ahref="http://www.sockets.com/winsock2.htm#OverView">Winsock 2 Overview</a>page.</p><a name="nextrev"></a><h5>1.4 - When is the next rev of the specification due out?</h5><p>The current revision (2.2) looks pretty durable to me. There are two things that could forceMicrosoft to create a new version of Winsock:</p><ol><li><i>A new transport protocol comes out that Microsoft wants to support.</i>Currently, Winsock supports all the common transport protocols, and thereseems to be no serious competition to replace frontrunners like TCP/IP.<li><i>Major changes to an existing network protocol.</i> This is due to happen once IPv6 takes off, because it requires changesto a lot of Winsock-level functionality, especially all the functionsthat depend on <code>sockaddr_in</code>.</ol><p>Windows 2000 was the most likely source of changes to the Winsockspec. Winsock <i>support</i> under Win2K did change, but not so that itrequired a new revision of the Winsock spec. Since Win2K will be with usuntil about 2003, and Microsoft's consumer OSes won't change Winsock,it's a pretty sure bet that we've got at least a few years of stabilityto look forward to.</p><a name="transport"></a><h5>1.5 - Can Winsock speak { DECNet, IPX/SPX, etc. }?</h5><p>Winsock 1.1 only provided real support for TCP/IP. Microsoft,Novell and a few other vendors did provide NetBIOS, IPX/SPX and support for other transport protocols through Winsock, but the point isthat this support was never standardized in the Winsock specification.</p><p>Winsock 2 changed this by providing standardized support for theDECNet, IPX/SPX and OSI transport protocols. I've heard that ATM's nativetransport has some semi-official Winsock support as well. (It requiresWinsock addons from your ATM card's vendor.) Support for other LAN/WANtransports are likely to follow as demand dictates.</p><a name="where"></a><h5>1.6 - Where can I get Winsock?</h5><p>Windows 95 and Windows NT 3.5 shipped with Winsock 1.1. Windows98 and Windows NT 4.0 and up shipped with Winsock 2.</p><p>Winsock is available as an add-on for Windows3.1. Probably the two most popular options are Microsoft's <ahref="ftp://ftp.microsoft.com/peropsys/windows/public/tcpip/WFWT32.EXE">Wolverine</a> stack and <a href="http://www.trumpet.com.au/">TrumpetWinsock</a>. The basic tradeoff between these two options is thatWolverine is free, while Trumpet is inexpensive shareware. Also, Trumpetcan do PPP (modem) connections, while Wolverine can't. Trumpet can alsorun on Windows 3.1, while Wolverine requires Windows for Workgroups.</p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -