再谈Winsock网络编程入门计算机等级考试

文章作者 100test 发表时间 2010:01:04 18:00:11
来源 100Test.Com百考试题网


  虽然自己接触网络编程已经很多年,但初学者还是需要入门的,这里谈谈我的在编写Windows网络应用程序的时候,最常用的便是Winsock接口,注意它不是网络协议,你可以理解它为网络应用API。

  Winsock简介

  Windows下网络编程的规范-Windows Sockets是Windows下得到广泛应用的、开放的、支持多种协议的网络编程接口。从1991年的1.0版到1995年的2.0.8版,经过不断完善并在Intel、Microsoft、Sun、SGI、Informix、Novell等公司的全力支持下,已成为Windows网络编程的事实上的标准。

  实际上Windows95以后的各个windows版本都支持Winsock2.2版本,但是Window CE 只支持1.1版本。Winsock2.2提供了更多的功能和API函数,而且区分两个版本的函数非常容易,2.2版本的API函数都以WSA开头的,除了 WSAStartup, WSACleanup, WSARecvEx, 和 WSAGetLastError这几个函数也出现在1.1版本中。

  微软Winsock 2官方介绍:

  Windows Sockets 2 (Winsock) enables programmers to create advanced Internet, intranet, and other network-capable applications to transmit application data across the wire, independent of the network protocol being used. With Winsock, programmers are provided access to advanced Microsoft? Windows? networking capabilities such as multicast and Quality of Service (QOS).

  Winsock follows the Windows Open System Architecture (WOSA) model. it defines a standard service provider interface (SPI) between the application programming interface (API), with its exported functions and the protocol stacks. It uses the sockets paradigm that was first popularized by Berkeley Software Distribution (BSD) UNIX. It was later adapted for Windows in Windows Sockets 1.1, with which Windows Sockets 2 applications are backward compatible. Winsock programming previously centered around TCP/IP. Some programming practices that worked with TCP/IP do not work with every protocol. As a result, the Windows Sockets 2 API adds functions where necessary to handle several protocols.

  Developer Audience

  Windows Sockets 2 is designed for use by C/C programmers. Familiarity with Windows networking is required.

  Run-Time Requirements

  Windows Sockets 2 can be used on all Windows platforms. Where certain implementations or capabilities of Windows Sockets 2 platform restrictions do exist, they are clearly noted in the documentation.

  In This Section

  Topic Description

  Whats New for Windows Sockets

  Information on new features for Windows Sockets.

  Network Protocol Support in Windows

  Information on network protocol support for Windows Sockets on different versions of Windows.

  About Winsock

  General information on Windows Sockets programming considerations, architecture, and capabilities available to developers.

  Using Winsock

  Procedures and programming techniques used with Windows Sockets. This section includes basic Winsock programming techniques, such as Getting Started With Winsock, as well as advanced techniques useful for experienced Winsock developers.

  Winsock Reference

  Documentation of the Windows Sockets API.


相关文章


封装几个关于流IStream的功能函数计算机等级考试
std::vector实例化不需要类定义计算机等级考试
生成手机号码文本c 程序源码计算机等级考试
C 中const用法浅析计算机等级考试
再谈Winsock网络编程入门计算机等级考试
计算机二级辅导:标准库assert.h计算机等级考试
VisualC tr1中的shared_ptr和随机数计算机等级考试
std::tr1全身都是宝计算机等级考试
钩子技术、HOOK技术在VC编程中的应用计算机等级考试
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛