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

📄 44.htm

📁 网络编程原理文摘 [文件] 精华区目录结构 [目录] 网络编程的基本原理 [目录] 网络编程与网络协议 [目录] 网上资源 [目录] winsock技术 [目录
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<HTML><HEAD><TITLE>CTerm非常精华下载</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type></HEAD>
<BODY bgColor=#ffffff>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=100% background=0044.jpg>
  <BODY>
  <TR>
    <TD height=150 rowSpan=2 width="308" ><IMG alt=DDl_back.jpg height=129 width=300 src="DDl_back.jpg" ></TD>
    <TD background=DDl_back2.jpg height=50 width="581" ><BIG><BIG><FONT face=黑体>
      <P align=center >重拳出击  一网打尽</FONT></BIG></BIG></P></TD></TR>
  <TR>
    <TD bgColor=#0099ff borderColor=#0099ff height=5 width="581"></TD></TR>
  <TR>
    <TD align=middle colSpan=2 height=100 vAlign=top width="891" ><BR>
<p align=center>[<a href="清华bbs网络资源.htm">回到开始</a>][<a href="6.htm">上一层</a>][<a href="45.htm">下一篇</a>]
<hr><p align="left"><small>发信人: Christopher (Chris), 信区: Winsock <br>

标  题: 一个不错的Winsocket站点 <br>

发信站: BBS 水木清华站 (Thu Feb 26 15:01:48 1998) <br>

  <br>

我在网上搜索到一个不错的winsocket站点,里面有一个winsock FAQ非常好,还包括几个 <br>

短小精悍的例程,如ftp client,ping,get mac address,etc. <br>

网址是 <br>

http://www.cyberport.com/~tangent/programming/winsock/ <br>

能出国的,有proxy的,赶快去吧! <br>

如果有人去不了,请通知我,我会想办法copy尽量多的内容给大家。 <br>

-- <br>

  <br>

※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 166.111.74.189] <br>

发信人: Christopher (Chris), 信区: Winsock <br>

标  题: Re: 一个不错的Winsocket站点 <br>

发信站: BBS 水木清华站 (Thu Feb 26 17:03:06 1998) <br>

  <br>

【 在 Christopher (Chris) 的大作中提到: 】 <br>

: 我在网上搜索到一个不错的winsocket站点,里面有一个winsock FAQ非常好,还包括几个 <br>

: 短小精悍的例程,如ftp client,ping,get mac address,etc. <br>

: 网址是 <br>

: http://www.cyberport.com/~tangent/programming/winsock/ <br>

: 能出国的,有proxy的,赶快去吧! <br>



: 如果有人去不了,请通知我,我会想办法copy尽量多的内容给大家。 <br>

  <br>

现将该FAQ的目录列在下面: <br>

Contents <br>

  <br>

Section 1 - General Winsock Information <br>

  <br>

     1.1 - What is Winsock? <br>

     1.2 - What is the latest version? <br>

     1.3 - When is the next rev of the specification? <br>

     1.4 - Where can I get a Winsock implementation? <br>

     1.5 - Why isn't there just one WINSOCK.DLL? Do I need a network stack to usse it? <br>

     1.6 - Is there a version of Winsock for { OS/2, DOS, UNIX, etc. }? <br>

     1.7 - Can Winsock speak { DECNet, IPX/SPX, etc. }? <br>

     1.8 - What does Winsock 2 have that Winsock 1.1 doesn't? <br>

     1.9 - Where can I get Winsock 2? <br>

  <br>

Section 2 - Issues for New Winsock Programmers <br>

  <br>

     2.1 - Are there any sample apps on the Net? <br>

     2.2 - Are there standard APIs for { FTP, Telnet, HTTP, etc. }? <br>

     2.3 - How do I get my IP address from within a Winsock propgram? <br>



     2.4 - What kind of socket should I use? <br>

     2.5 - Do I need to initialize the WSAData structure before calling WSAStarttup? <br>

     2.6 - If I write a Winsock program, will I be able to communicate with a UNNIX Sockets program? <br>

     2.7 - Can I use Winsock with { Delphi, Visual Basic, Visual Cobol, etc. }? <br>

     2.8 - How do I detect when the connection is closed? <br>

     2.9 - How can I debug my Winsock program? <br>

     2.10 - How do I get a readable error message from a Winsock error number? <br>

     2.11 - Winsock keeps returning the error WSAEWOULDBLOCK. What's wrong with my program? <br>

     2.12 - Winsock keeps corrupting my data; I thought TCP was supposed to be rreliable! <br>

     2.13 - I've read Question 2.12, and that's not the problem. Have any more bbright ideas? <br>

  <br>

Section 3 - Advanced Winsock Issues <br>

  <br>

     3.1 - How can I open a raw data socket? <br>

     3.2 - How can I "ping" another machine with Winsock? <br>

     3.3 - How do I share a socket between two processes? <br>

     3.4 - Why is ioctlsocket() so crippled compared to UNIX ioctl()? <br>

     3.5 - How can I get the local username? <br>

     3.6 - Is it possible to create sockets that map to a DLL rather than an appplication? <br>

     3.7 - How do I do a { readv(), fcntl(), etc. } call in my Winsock applicatiion? <br>

     3.8 - How do I get the MAC (a.k.a. hardware) address of the local Ethernet adapter? <br>

     3.9 - In a multithreaded application, can more than one thread access a sinngle socket? <br>



     3.10 - If two threads in an application call recv() on a socket, will they each get the same data? <br>

     3.11 - Is there any way for two threads to be notified when something happeens on a socket? <br>

     3.12 - How do I detect if the modem is connected? <br>

     3.13 - How can I capture packets on a LAN with Winsock? <br>

     3.14 - How can I change the IP or TCP header of a packet? <br>

     3.15 - When should I turn off the Nagle algorithm? <br>

  <br>

Section 4 - Resources <br>

  <br>

     4.1 - Winsock Libraries and Controls <br>

     4.2 - Sample Winsock Applications and Tutorials <br>

     4.3 - Web Pages <br>

     4.4 - Winsock SDKs and Specifications <br>

     4.5 - Winsock Debugging Tools <br>

     4.6 - Network Suite Vendors <br>

     4.7 - Miscellaneous <br>

  <br>

Section 5 - Examples <br>

  <br>

     Example 1 - Getting the Local IP Address <br>

     Example 2 - Pinging a Host Using Microsoft's ICMP.DLL <br>

     Example 3 - Pinging a Host Using Raw Sockets <br>



     Example 4 - How to Get the Local User Name <br>

     Example 5 - How to Pass a Socket Handle in Win32 <br>

     Example 6 - How to Get the MAC (a.k.a. "hardware") Address, NetBIOS method <br>

     Example 7 - How to Get the MAC (a.k.a. "hardware") Address, RPC method <br>

     Example 8 - Getting the Network Interface List <br>

  <br>

Section 6 - Tutorials <br>

  <br>

     Tutorial 1 - What Kind of Socket Should I Use? <br>

     Tutorial 2 - Winsock for the Impatient <br>

  <br>

Section 7 - Glossary <br>

如果有人感兴趣我再贴内容。 <br>

-- <br>

人生在世,如果不能喝酒,不能想女人,连人家欺负到了头上也不能还手,还不如死了算了了  <br>

  <br>

※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 166.111.74.189] <br>

发信人: Christopher (Chris), 信区: Winsock <br>

标  题: Re: 一个不错的Winsocket站点 <br>

发信站: BBS 水木清华站 (Fri Feb 27 10:04:43 1998) <br>

  <br>

【 在 Christopher (Chris) 的大作中提到: 】 <br>



: 如果有人感兴趣我再贴内容。 <br>

现贴出第一部分。属入门级读物。由于BBS格式限制,建议大家用WWW方式浏览本文。 <br>

  <br>

Section 1 - General Winsock Information <br>

  <br>

1.1 - What is Winsock? <br>

  <br>

     The Windows Sockets (usually abbreviated "Winsock" or "WinSock") specificattion defines a network programming <br>

     interface for Microsoft Windows which is based on the "socket" paradigm poppularized in BSD UNIX. It encompasses <br>

     both familiar Berkeley socket style routines and a set of Windows-specific extensions designed to allow the programmer <br>

     to take advantage of the message-driven nature of Windows. <br>

  <br>

     Winsock provides a single API for application developers, to which multiplee network software vendors can conform. <br>

     The specification thus defines the library calls and associated semantics tto which an application developer can program <br>

     and which a network software vendor can implement. <br>

  <br>

1.2 - What is the latest version? <br>

  <br>

     The latest version is 2.2.1, but most machines are still running Winsock 1..1. This is because only Windows NT 4.0 <br>

     includes Winsock 2 out of the box. See Question 1.9 for more information onn operating system support for Winsock 2. <br>

  <br>

     By the way, most people just say "Winsock 2" when speaking of the current vversion of Winsock, because the newer <br>



     versions just contain edits and clarifications to the original spec. <br>

  <br>

1.3 - When is the next rev of the specification due out? <br>

  <br>

     It's hard to say. Winsock 1.1 was out in January 1993, and Winsock 2.0 was due out in late 1993. What actually <br>

     happened was that Winsock 2.0 didn't surface until 1995 sometime -- such iss the nature of the standards process. <br>

  <br>

     Also, I'm not sure what else the spec needs, excepting support for emergingg LAN/WAN protocols. Given that, I would <br>

     bet that betas of the next major revision of Winsock will arrive something like a year ahead of the appearance of IPv6 on <br>

     Windows. <br>

  <br>

     Another issue is that Winsock 2 isn't really "done" yet. A number of initiaatives mentioned in the original Winsock 2.0 spec <br>

     have not yet been implemented or defined fully. These initiatives will probbably be implemented in future versions of <br>

     Winsock, some versions of which may not appear for current versions of Winddows. For example, Quality of Service is <br>

     not yet implemented, and may only be implemented in Windows 98 and Windows NT 5.0. Complete information on the <br>

     status of Winsock 2 is available at sockets.com's Winsock 2 Status Page. <br>

  <br>

1.4 - Where can I get a Winsock implementation? <br>

  <br>

     Microsoft ships a version of Winsock with Windows 95 and Windows NT. The addvantages of these versions is that they <br>

     are free and work directly with the operating systems' native network stackks. A few vendors still maintain alternative <br>

     Winsock stacks (mainly on Windows 95) to give their products an edge, but mmost people just stick with the native <br>



     stacks. <br>

  <br>

     Probably the two most popular options for Winsock stacks on Windows 3.1 aree Microsoft's Wolverine stack and <br>

     Trumpet Winsock. The basic tradeoff between these two options is that Wolveerine is free, while Trumpet is inexpensive <br>

     shareware. Also, Trumpet can do PPP (modem) connections, while Wolverine caan't. Trumpet can also run on Windows <br>

     3.1, while Wolverine requires Windows for Workgroups. <br>

  <br>

     The other major source for 16-bit Winsock stacks is the major networking sooftware vendors, especially those that sell <br>

     "network suites." Network suites are combined packages of common internetwoorking client applications like telnet, <br>

     X-Windows, NFS, email and network news. There is a list of network suite veendors on the Resources page. <br>

  <br>

     Keep in mind that you can't copy a WINSOCK.DLL (or WSOCK32.DLL, or WS2_32.DDLL) to another machine and <br>

     expect it to work. You have to get and install a complete network stack, inncluding its proprietary Winsock. <br>

  <br>

1.5 - Why isn't there just one WINSOCK.DLL? Do I need a network stack to use it? <br>

  <br>

     Winsock defines the top level of a network stack, the part which is called by user programs. The method a given <br>

     Winsock will use to access the network depends on the networking package yoou have installed, and therefore must vary. <br>

  <br>

     Although you generally do need a networking stack to use Winsock, you can ssometimes get away with one of a few <br>

     workarounds, in a pinch. The first is to use a dummy Winsock, which doesn'tt do much more than implement an empty <br>

     WINSOCK.DLL. These are mainly useful for using, say, Netscape while offlinee. The other method is to install a network <br>



     stack that allows you to be disconnected, such as a PPP stack. You might thhen be able to connect through this Winsock <br>

     to the "localhost address" (127.0.0.1) to test Winsock programs. This methood also has problems, however, because a <br>

     Winsock's localhost connectivity is not guaranteed to exist by the spec, muuch less work the same way a "normal" <br>

     Winsock connection will work. <br>

⌨️ 快捷键说明

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