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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆日韩欧美久久| 丝袜美腿亚洲一区| 成人激情动漫在线观看| 国产精品三级av在线播放| 国产精品一级二级三级| 中文一区在线播放| 色综合久久88色综合天天6 | av一区二区不卡| 亚洲欧美激情一区二区| 欧美情侣在线播放| 国产精品一区二区x88av| 亚洲欧美另类久久久精品2019| 日本黄色一区二区| 毛片一区二区三区| 亚洲国产激情av| 欧美日韩电影在线| 韩国理伦片一区二区三区在线播放 | 美女视频一区在线观看| 久久久91精品国产一区二区精品 | 国产乱人伦偷精品视频不卡| 国产精品久久久久永久免费观看| 欧洲精品在线观看| 国产毛片精品视频| 亚洲国产成人av| 久久久久9999亚洲精品| 欧美亚洲高清一区| 国产精品18久久久久| 一区二区三区在线视频观看58| 欧美一区二区三区视频免费播放| 国产一区二区三区视频在线播放| 日韩伦理av电影| 欧美刺激午夜性久久久久久久| 成人精品国产免费网站| 日韩高清在线观看| 亚洲精品视频在线看| 精品国产不卡一区二区三区| 91浏览器在线视频| 国产一区二区91| 日韩精品一区第一页| 亚洲欧洲精品一区二区三区不卡| 欧美一区二区三区视频在线| 色综合久久精品| 成人中文字幕电影| 男人操女人的视频在线观看欧美 | 五月激情综合网| 国产精品久久三区| 久久亚洲影视婷婷| 日韩精品中文字幕一区| 色噜噜偷拍精品综合在线| 久草热8精品视频在线观看| 亚洲国产综合91精品麻豆| 国产片一区二区三区| 91麻豆精品91久久久久久清纯| 91在线国产福利| 成人美女视频在线观看| 狠狠久久亚洲欧美| 美女视频免费一区| 日本特黄久久久高潮| 亚洲一区二三区| 亚洲日本va在线观看| 日本一区二区视频在线| 久久午夜色播影院免费高清| 欧美成人vr18sexvr| 欧美人与禽zozo性伦| 91成人在线精品| 在线观看网站黄不卡| 91官网在线观看| 91性感美女视频| 色综合视频一区二区三区高清| 成人深夜福利app| 成人爽a毛片一区二区免费| 国产91丝袜在线观看| 国产成人综合精品三级| 成人美女在线视频| 国产成人精品影视| 成人av手机在线观看| kk眼镜猥琐国模调教系列一区二区| 美女视频黄久久| 九九九久久久精品| 国产福利91精品一区二区三区| 国产经典欧美精品| 成人免费高清在线| 91日韩精品一区| 欧美色图激情小说| 3atv在线一区二区三区| 日韩亚洲欧美综合| 久久午夜电影网| 亚洲色图20p| 亚洲一区免费在线观看| 免费在线观看视频一区| 国内精品视频一区二区三区八戒| 国产一区二区按摩在线观看| 国产高清久久久| 色婷婷综合久久| 51精品秘密在线观看| 日韩欧美色综合| 中文字幕不卡在线播放| 一区二区三区蜜桃| 日韩国产高清影视| 风间由美一区二区三区在线观看| av电影天堂一区二区在线 | 亚洲嫩草精品久久| 亚洲成av人片www| 国模一区二区三区白浆 | 欧美亚洲一区三区| 91精品国产综合久久久久久久久久| 日韩免费电影一区| 久久久久国产精品人| 亚洲黄色免费网站| 精品一区二区久久| 99r国产精品| 日韩欧美国产精品| 亚洲欧美日韩久久精品| 日韩国产在线观看一区| 波波电影院一区二区三区| 欧洲国内综合视频| 久久奇米777| 午夜精品一区二区三区免费视频| 国产剧情一区二区三区| 91一区二区三区在线播放| 91麻豆精品国产无毒不卡在线观看 | 国产乱子伦视频一区二区三区 | 国产成都精品91一区二区三| 色综合咪咪久久| 久久久久久久久伊人| 一区二区在线电影| 国产精品夜夜爽| 欧美久久高跟鞋激| 亚洲丝袜另类动漫二区| 国产酒店精品激情| 欧美一级理论性理论a| 一区二区视频在线| 成人精品在线视频观看| 欧美一区永久视频免费观看| 国产精品成人一区二区艾草| 精品一区二区三区视频在线观看| 欧美熟乱第一页| 中文字幕在线一区| 国产在线观看一区二区| 91超碰这里只有精品国产| 亚洲精品视频一区二区| 国产成人免费网站| 日韩午夜小视频| 日韩高清一区二区| 欧美日韩大陆一区二区| 一级日本不卡的影视| 高清不卡一区二区| 久久久久九九视频| 久久成人18免费观看| 3d动漫精品啪啪1区2区免费| 亚洲国产乱码最新视频| 91天堂素人约啪| 国产精品久久久久一区| 成人美女在线视频| 国产精品久久久久久久午夜片| 国产精品99久久久| 久久久久久久免费视频了| 久久丁香综合五月国产三级网站| 欧美日韩免费观看一区三区| 亚洲日本一区二区| 色呦呦网站一区| 亚洲精品国产一区二区精华液| 99视频在线精品| 国产精品人人做人人爽人人添| 国产69精品一区二区亚洲孕妇 | 精品三级在线观看| 久草精品在线观看| 久久久精品国产99久久精品芒果| 国产精品资源在线| 国产嫩草影院久久久久| voyeur盗摄精品| 一区二区三区在线播| 欧美日韩一区 二区 三区 久久精品| 亚洲欧美一区二区三区国产精品 | 成人高清在线视频| 亚洲视频一区二区免费在线观看| 色偷偷成人一区二区三区91| 一级做a爱片久久| 91精品国产色综合久久不卡电影| 激情综合色综合久久综合| 久久蜜桃一区二区| av网站免费线看精品| 亚洲日本在线视频观看| 欧美日韩午夜在线| 玖玖九九国产精品| 欧美国产一区视频在线观看| 99久久777色| 午夜激情综合网| 久久久一区二区三区捆绑**| 懂色一区二区三区免费观看| 亚洲欧洲中文日韩久久av乱码| 色吧成人激情小说| 日本在线播放一区二区三区| 久久久久久久久免费| 色综合久久久久久久久| 日韩av电影天堂| 国产精品系列在线| 欧美日韩电影在线播放| 国产麻豆精品在线| 亚洲成av人片|