设为首页 加入收藏

TOP

再谈Winsock网络编程入门
2014-11-15 22:00:25 】 浏览:4141
Tags:再谈 Winsock 网络编程 入门

  虽然自己接触网络编程已经很多年,但初学者还是需要入门的,这里谈谈我的在编写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


  What's 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.


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇计算机二级辅导:标准库assert.h 下一篇C++中const用法浅析

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目