亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch18.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!--

function popUp(pPage) {
 var fullURL = document.location;
 var textURL = fullURL.toString();
 var URLlen = textURL.length;
 var lenMinusPage = textURL.lastIndexOf("/");
 lenMinusPage += 1;
 var fullPath = textURL.substring(0,lenMinusPage);
 popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394');
 figDoc= popUpWin.document;
 zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>';
 zhtm += '<link rel="stylesheet" href="/includes/stylesheets/ebooks.css"></head>';
 zhtm += '<BODY bgcolor="#FFFFFF">';
 zhtm += '<IMG SRC="' + fullPath + pPage + '">';
 zhtm += '<P><B>' + pPage + '</B>';
 zhtm += '</BODY></HTML>';
 window.popUpWin.document.write(zhtm);
 window.popUpWin.document.close();
 // Johnny Jackson 4/28/98
 }

//-->
                                                                
</SCRIPT>
<link rel="stylesheet" href="/includes/stylesheets/ebooks.css">

	
	<TITLE>Special Edition Using Visual C++ 6 -- Ch 18 -- Sockets, MAPI, and the Internet</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<CENTER>
<H1><IMG SRC="../button/que.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR>
Special Edition Using Visual C++ 6</H1>
</CENTER>
<CENTER>
<P><A HREF="../ch17/ch17.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch19/ch19.htm"><IMG
SRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> 
<HR>

</CENTER>
<CENTER>
<H1>- 18 -</H1>
</CENTER>
<CENTER>
<H1>Sockets, MAPI, and the Internet</H1>
</CENTER>

<UL>
	<LI><A HREF="#Heading1">Using Windows Sockets</A>
	<UL>
		<LI><A HREF="#Heading2">Winsock in MFC</A>
	</UL>
	<LI><A HREF="#Heading3">Using the Messaging API (MAPI)</A>
	<UL>
		<LI><A HREF="#Heading4">What Is MAPI?</A>
		<LI><A HREF="#Heading5">Win95 Logo Requirements</A>
		<LI><A HREF="#Heading6">Advanced Use of MAPI</A>
	</UL>
	<LI><A HREF="#Heading7">Using the WinInet Classes</A>
	<LI><A HREF="#Heading8">Using Internet Server API (ISAPI) Classes</A>
</UL>

<P>
<HR SIZE="4">

<CENTER>
<H1></H1>
</CENTER>
<H2><A NAME="Heading1"></A>Using Windows Sockets</H2>
<P>There are a number of ways your applications can communicate with other applications
through a network like the Internet. This chapter introduces you to the concepts
involved with these programming techniques. Subsequent chapters cover some of these
concepts in more detail.</P>
<P>Before the Windows operating system even existed, the Internet existed. As it
grew, it became the largest TCP/IP network in the world. The early sites were UNIX
machines, and a set of conventions called Berkeley sockets became the standard for
TCP/IP communication between UNIX machines on the Internet. Other operating systems
implemented TCP/IP communications, too, which contributed immensely to the Internet's
growth. On those operating systems, things were becoming messy, with a wide variety
of proprietary implementations of TCP/IP. Then a group of more than 20 vendors banded
together to create the Winsock specification.</P>
<P>The Winsock specification defines the interface to a DLL, typically called WINSOCK.DLL
or WSOCK32.DLL. Vendors write the code for the functions themselves. Applications
can call the functions, confident that each function's name, parameter meaning, and
final behavior are the same no matter which DLL is installed on the machine. For
example, the DLLs included with Windows 95 and Windows NT are not the same at all,
but a 32-bit Winsock application can run unchanged on a Windows 95 or Windows NT
machine, calling the Winsock functions in the appropriate DLL.</P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>NOTE:</strong> Winsock isn't confined to TCP/IP communication. IPX/SPX support is
	the second protocol supported, and there will be others. For more information, check
	the Winsock specification itself. The Stardust Labs Winsock Resource Page at <A target="_new" HREF="http://www.stardust.com/wsresource/"><B>http://www.stardust.com/wsresource/</B></A>
	is a great starting point.&#160;n 
<HR>


</BLOCKQUOTE>

<P>An important concept in sockets programming is a socket's port. Every Internet
site has a numeric address called an <I>IP address,</I> typically written as four
numbers separated by dots: <B>198.53.145.3</B>, for example. Programs running on
that machine are all willing to talk, by using sockets, to other machines. If a request
arrives at <B>198.53.145.3</B>, which program should handle it?</P>
<P>Requests arrive at the machine, carrying a <I>port number--</I>a number from 1,024
and up that indicates which program the request is intended for. Some port numbers
are reserved for standard use; for example, Web servers traditionally use port 80
to listen for Web document requests from client programs like Netscape Navigator.</P>
<P>Most socket work is <I>connection-based</I>: Two programs form a connection with
a socket at each end and then send and receive data along the connection. Some applications
prefer to send the data without a connection, but there is no guarantee that this
data will arrive. The classic example is a time server that regularly sends out the
current time to every machine near it without waiting until it is asked. The delay
in establishing a connection might make the time sent through the connection outdated,
so it makes sense in this case to use a connectionless approach.</P>
<P>
<H3><A NAME="Heading2"></A>Winsock in MFC</H3>
<P>At first, sockets programming in Visual C++ meant making API calls into the DLL.
Many developers built socket classes to encapsulate these calls. Visual C++ 2.1 introduced
two new classes: CAsyncSocket and CSocket (which inherits from CAsyncSocket). These
classes handle the API calls for you, including the startup and cleanup calls that
would otherwise be easy to forget.</P>
<P>Windows programming is <I>asynchronous</I>: lots of different things happen at
the same time. In older versions of Windows, if one part of an application was stuck
in a loop or otherwise hung up, the entire application--and sometimes the entire
operating system--would stick or hang with it. This is obviously something to avoid
at all costs. Yet a socket call, perhaps a call to read some information through
a TCP/IP connection to another site on the Internet, might take a long time to complete.
(A function that is waiting to send or receive information on a socket is said to
be <I>blocking</I>.) There are three ways around this problem:</P>

<UL>
	<LI>Put the function that might block in a thread of its own. The thread will block,
	but the rest of the application will carry on.
	<P>
	<LI>Have the function return immediately after making the request, and have another
	function check regularly (<I>poll</I> the socket) to see whether the request has
	completed.
	<P>
	<LI>Have the function return immediately, and send a Windows message when the request
	has completed.
</UL>

<P>The first option was not available until recently, and the second is inefficient
under Windows. Most Winsock programming adopts the third option. The class CAsyncSocket
implements this approach. For example, to send a string across a connected socket
to another Internet site, you call that socket's Send() function. Send() doesn't
necessarily send any data at all; it tries to, but if the socket isn't ready and
waiting, Send() just returns. When the socket is ready, a message is sent to the
socket window, which catches it and sends the data across. This is called <I>asynchronous
Winsock programming.</I></P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>NOTE:</strong> Winsock programming isn't a simple topic; entire books have been
	written on it. If you decide that this low-level sockets programming is the way to
	go, building standard programs is a good way to learn the process.&#160;n 
<HR>


</BLOCKQUOTE>

<P><B><I>CAsyncSocket</I>&#160;&#160;</B>The CAsyncSocket class is a wrapper class
for the asynchronous Winsock calls. It has a number of useful functions that facilitate
using the Winsock API. Table 18.1 lists the CAsyncSocket member functions and responsibilities.</P>
<P>
<H4>Table 18.1&#160;&#160;CAsyncSocket Member Functions</H4>
<P>
<TABLE BORDER="1">
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT"><B>Method Name</B></TD>
		<TD ALIGN="LEFT"><B>Description</B></TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">Accept</TD>
		<TD ALIGN="LEFT">Handles an incoming connection on a listening socket, filling a new socket with the
			address information.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">AsyncSelect</TD>
		<TD ALIGN="LEFT">Requests that a Windows message be sent when a socket is ready.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">Attach</TD>
		<TD ALIGN="LEFT">Attaches a socket handle to a CAsyncSocket instance so that it can form a connection
			to another machine.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">Bind</TD>
		<TD ALIGN="LEFT">Associates an address with a socket.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">Close</TD>
		<TD ALIGN="LEFT">Closes the socket.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">Connect</TD>
		<TD ALIGN="LEFT">Connects the socket to a remote address and port.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">Create</TD>
		<TD ALIGN="LEFT">Completes the initialization process begun by the constructor.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">Detach</TD>
		<TD ALIGN="LEFT">Detaches a previously attached socket handle.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">FromHandle</TD>
		<TD ALIGN="LEFT">Returns a pointer to the CAsyncSocket attached to the handle it was passed.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">GetLastErro</TD>
		<TD ALIGN="LEFT">Returns the error code of the socket. After an operation fails, call GetLastError
			to find out why.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">GetPeerName</TD>
		<TD ALIGN="LEFT">Finds the IP address and port number of the remote socket that the calling object
			socket is connected to, or fills a socket address structure with that information.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">GetSockName</TD>
		<TD ALIGN="LEFT">Returns the IP address and port number of this socket, or fills a socket address
			structure with that information.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">GetSockOpt</TD>
		<TD ALIGN="LEFT">Returns the currently set socket options.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">IOCtl</TD>
		<TD ALIGN="LEFT">Sets the socket mode most commonly to blocking or non-blocking.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">Listen</TD>
		<TD ALIGN="LEFT">Instructs a socket to watch for incoming connections.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">OnAccept</TD>
		<TD ALIGN="LEFT">Handles the Windows message generated when a socket has an incoming connection to
			accept (often overridden by derived classes).</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">OnClose</TD>
		<TD ALIGN="LEFT">Handles the Windows message generated when a socket closes (often overridden by derived
			classes).</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">OnConnect</TD>
		<TD ALIGN="LEFT">Handles the Windows message generated when a socket becomes connected or a connection
			attempt ends in failure (often overridden by derived classes).</TD>
	</TR>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲图片欧美一区| 亚洲成人av中文| 亚洲乱码国产乱码精品精98午夜 | 国产一区二区在线视频| 日韩激情av在线| 日本欧美一区二区| 老司机午夜精品| 国产麻豆精品在线观看| 国产成人免费视频一区| 成人免费视频caoporn| 99九九99九九九视频精品| 91丨九色丨尤物| 欧美亚日韩国产aⅴ精品中极品| 色婷婷综合久色| 在线91免费看| 久久网站热最新地址| 国产日韩欧美在线一区| 国产精品福利在线播放| 亚洲国产精品视频| 另类欧美日韩国产在线| 丁香激情综合五月| 欧美色窝79yyyycom| 精品成人在线观看| 中文字幕一区二区三区四区 | 亚洲日本va午夜在线影院| 亚洲一区在线看| 久久99精品一区二区三区三区| 国产在线精品一区二区夜色| 风间由美中文字幕在线看视频国产欧美| 国产一区二区日韩精品| 一本一道综合狠狠老| 91精品国产黑色紧身裤美女| 欧美经典三级视频一区二区三区| 亚洲欧美国产三级| 久久99精品国产麻豆不卡| 不卡一区二区三区四区| 91精品国产福利| 18涩涩午夜精品.www| 美女任你摸久久| 欧美系列一区二区| 日本一区二区视频在线观看| 亚洲成人黄色影院| 成人午夜免费av| 精品免费视频.| 一卡二卡三卡日韩欧美| 国产剧情一区二区| 在线免费观看日韩欧美| 欧美—级在线免费片| 奇米综合一区二区三区精品视频| 99热这里都是精品| 欧美福利一区二区| 亚洲欧洲一区二区三区| 美腿丝袜一区二区三区| 欧美日韩免费一区二区三区| 国产日韩欧美精品电影三级在线| 视频一区中文字幕| 91福利在线免费观看| 国产精品视频看| 国产一区二区三区国产| 日韩欧美在线123| 亚洲一区在线视频观看| av午夜一区麻豆| 国产校园另类小说区| 韩国v欧美v日本v亚洲v| 在线播放一区二区三区| 亚洲午夜激情网站| 一本一本久久a久久精品综合麻豆| 久久综合九色综合欧美就去吻| 日日欢夜夜爽一区| 51精品秘密在线观看| 亚洲成人免费看| 欧美高清视频一二三区 | 欧美日韩一区高清| 亚洲精品欧美综合四区| 色婷婷av久久久久久久| 亚洲精品乱码久久久久久日本蜜臀| 福利91精品一区二区三区| 国产三级欧美三级日产三级99| 国产精品一区二区无线| 久久在线免费观看| 东方aⅴ免费观看久久av| 国产日韩亚洲欧美综合| 成人avav影音| 尤物在线观看一区| 欧美欧美欧美欧美首页| 美女尤物国产一区| 精品99999| 99精品欧美一区二区三区小说| **性色生活片久久毛片| 日本道在线观看一区二区| 午夜一区二区三区在线观看| 777亚洲妇女| 国产又黄又大久久| 国产精品白丝在线| 欧美午夜精品一区二区蜜桃| 日本不卡视频在线| 日本一区二区高清| 在线视频一区二区免费| 日本v片在线高清不卡在线观看| 精品噜噜噜噜久久久久久久久试看| 国产专区综合网| 亚洲免费色视频| 91精品国产欧美一区二区成人| 国产美女精品人人做人人爽| 国产精品久久久久永久免费观看 | 日韩成人av影视| 久久久久久久久99精品| 欧美综合亚洲图片综合区| 日韩精品欧美成人高清一区二区| 精品国产一区二区精华| 99久久99久久精品免费观看| 天天色天天爱天天射综合| 国产午夜亚洲精品午夜鲁丝片| 91看片淫黄大片一级| 麻豆精品久久久| 成人欧美一区二区三区白人| 欧美日韩国产一区二区三区地区| 亚洲综合色自拍一区| 欧美视频一区在线| 国产在线观看一区二区| 一区二区高清免费观看影视大全 | 国产精品免费丝袜| 6080亚洲精品一区二区| 成人免费av资源| 人人狠狠综合久久亚洲| 综合久久国产九一剧情麻豆| 精品国产伦理网| 777色狠狠一区二区三区| 色欧美日韩亚洲| www.欧美.com| 激情综合亚洲精品| 午夜私人影院久久久久| 成人免费一区二区三区在线观看| 精品国产一区二区亚洲人成毛片| 欧美在线不卡一区| 91蝌蚪porny九色| 成人综合在线观看| 国产综合色产在线精品| 日本美女一区二区三区| 亚州成人在线电影| 亚洲国产一区二区在线播放| 亚洲人成伊人成综合网小说| 国产日韩欧美一区二区三区乱码| 精品国产伦一区二区三区观看方式| 欧美高清视频一二三区| 欧美疯狂做受xxxx富婆| 欧美精品一二三四| 欧美日韩免费高清一区色橹橹| 在线免费av一区| 欧美丝袜自拍制服另类| 欧美曰成人黄网| 欧美美女视频在线观看| 欧美日韩国产首页在线观看| 欧美日韩精品一区二区在线播放| 在线观看一区日韩| 欧美日韩另类一区| 欧美一区二区三区视频在线| 4438成人网| 欧美一区二区三区在线观看视频| 欧美色图一区二区三区| 欧美亚日韩国产aⅴ精品中极品| 色婷婷亚洲一区二区三区| 欧美亚洲高清一区二区三区不卡| 欧美午夜一区二区三区| 51精品久久久久久久蜜臀| 日韩精品一区二区三区视频| 久久综合狠狠综合| 中文字幕一区二区三区四区不卡| 亚洲欧美日韩国产手机在线| 亚洲在线一区二区三区| 日韩av网站在线观看| 国内精品国产三级国产a久久| 国产91高潮流白浆在线麻豆| 色综合中文字幕| 欧美日韩激情在线| 国产亚洲一区二区在线观看| 亚洲欧美日韩在线播放| 日韩在线播放一区二区| 国产精品资源在线观看| 91日韩一区二区三区| 欧美一区午夜精品| 国产精品色一区二区三区| 亚洲一本大道在线| 国产在线看一区| 欧美影院一区二区三区| 2023国产精品视频| 亚洲六月丁香色婷婷综合久久| 午夜精品久久久久久久| 国产一区不卡视频| 欧美日韩亚洲高清一区二区| 久久综合精品国产一区二区三区 | 91传媒视频在线播放| 精品999久久久| 一片黄亚洲嫩模| 东方欧美亚洲色图在线| 5858s免费视频成人| 国产精品伦理在线| 美女在线一区二区| 91国产视频在线观看| 国产亚洲人成网站|