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

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

?? tyt14fi.htm

?? 快速學(xué)習(xí)TCP/IP協(xié)議
?? HTM
?? 第 1 頁 / 共 3 頁
字號(hào):
<IMG SRC="note.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/note.gif" WIDTH = 75 HEIGHT = 46>Connectionless protocols such as UDP do not require a connected state to function. They can, however, be connected to enable transfer between the two sockets without having to specify the destination address each time. Connection-based protocols such as TCP require both ends of the connection to be specified.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<P>To establish a connection to a remote socket, the connect function is used. The connect function's format is

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">connect(<I>socket</I>, <I>destination_address</I>, <I>address_length</I>)</FONT></PRE>

<P>The <I>socket</I> is the integer number of the socket to which to connect; the <I>destination_address</I> is the socket address data structure for the destination address (using the same format as shown in Figure 14.1); and the <I>address_length</I> is the length of the destination address in bytes.

<BR>

<P>The manner in which connect functions is protocol-dependent. For TCP, connect establishes the connection between the two endpoints and returns the information about the remote socket to the application. If a connection can't be established, an error message is generated. For a connectionless protocol such as UDP, the connect function is still necessary but stores only the destination address for the application.

<BR>

<BR>

<A ID="E69E182" NAME="E69E182"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>The </B><B><I>open</I></B><B> Command</B></FONT></CENTER></H4>

<BR>

<P>The open command prepares a communications port for communications. This is an alternative to the combination of the functions shown previously, used by applications for specific purposes. There are really three kinds of open commands, two of which set a server to receive incoming requests and the third used by a client to initiate a request. With every open command, a TCB is created for that connection.

<BR>

<P>The three open commands are an unspecified passive open (which enables a server to wait for a connection request from any client), a fully specified passive open (which enables a server to wait for a connection request from a specific client), and an active open (which initiates a connection with a server). The input and output expected from each command are shown in Table 14.1.

<BR>

<BR>

<P ALIGN=CENTER>

<CENTER>

<FONT COLOR="#000080"><B>Table 14.1. Open command parameters.</B></FONT></CENTER>

<BR>



<CENTER><TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 CELLPADDING=3 >

<TR>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P><B><I>Type</I></B>

</FONT>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P><B><I>Input</I></B>

</FONT>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P><B><I>Output</I></B>

</FONT>

<TR>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>Unspecified

<BR>

</FONT>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>local port

<BR>

</FONT>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>local connection name

<BR>

</FONT>

<TR>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>passive open

<BR>

</FONT>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>Optional: timeout, precedence, security, maximum segment size

<BR>

</FONT>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>local connection name

<BR>

</FONT>

<TR>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>Fully specified passive open

<BR>

</FONT>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>local port, remote IP address, remote port Optional: timeout, precedence, security, maximum segment size

<BR>

</FONT>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>local connection name

<BR>

</FONT>

<TR>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>Active open

<BR>

</FONT>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>local port, destination IP address, destination port Optional: timeout, precedence, security, maximum segment size

<BR>

</FONT>

<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<P>local connection name</FONT>

</TABLE></CENTER><BR>

<P>When an open command is issued by an application, a set of functions within the socket interface is executed to set up the TCB, initiate the socket number, and establish preliminary values for the variables used in the TCB and the application.

<BR>

<P>The passive open command is issued by a server to wait for incoming requests. With the TCP (connection-based) protocol, the passive open issues the following function calls:

<BR>

<UL>

<LI>socket: Creates the sockets and identifies the type of communications.

<BR></LI>

<BR>

<LI>bind: Establishes the server socket for the connection.

<BR></LI>

<BR>

<LI>listen: Establishes a client queue.

<BR></LI>

<BR>

<LI>accept: Waits for incoming connection requests on the socket.

<BR></LI>

<BR>

</UL>

<P>The active open command is issued by a client. For TCP, it issues two functions:

<BR>

<UL>

<LI>socket: Creates the socket and identifies the communications type.

<BR></LI>

<BR>

<LI>connect: Identifies the server's IP address and port; attempts to establish communications.

<BR></LI>

<BR>

</UL>

<P>If the exact port to use is specified as part of the open command, a bind function call replaces the connect function.

<BR>

<BR>

<A ID="E69E183" NAME="E69E183"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Sending Data</B></FONT></CENTER></H4>

<BR>

<P>There are five functions within the Socket API for sending data through a socket. These are send, sendto, sendmsg, write, and writev. Not surprisingly, all these functions send data from the application to TCP. They do this through a buffer created by the application (for example, it might be a memory address or a character string), passing the entire buffer to TCP. The send, write, and writev functions work only with a connected socket because they have no provision to specify a destination address within their function call.

<BR>

<P>The format of the send function is simple. It takes the local socket connection number, the buffer address for the message to be sent, the length of the message in bytes, a Push flag, and an Urgent flag as parameters. An optional timeout might be specified. Nothing is returned as output from the send function. The format is

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">send(<I>socket</I>, <I>buffer_address</I>, <I>length, flags</I>)</FONT></PRE>

<P>The sendto and sendmsg functions are similar except they enable an application to send a message through an unconnected socket. They both require the destination address as part of their function call. The sendmsg function is simpler in format than the sendto function, primarily because another data structure is used to hold information. The sendmsg function is often used when the format of the sendto function would be awkward and inefficient in the application's code. Their formats are

<BR>

<PRE>

<FONT COLOR="#000080">sendto(<I>socket</I>, <I>buffer</I>_<I>address</I>, <I>length</I>, <I>flags</I>, <I>destination</I>, <I>address</I>_<I>length</I>)

sendmsg(<I>socket</I>, <I>message</I>_<I>structure</I>, <I>flags</I>)</FONT></PRE>

<P>The last two parameters in the sendto function are the destination address and the length of the destination address. The address is specified using the format shown in Figure 14.1. The <I>message_structure</I> of the sendmsg function contains the information left out of the sendto function call. The format of the message structure is shown in Figure 14.3.

<BR>

<P><B><A HREF="14tyt03.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/14tyt03.gif">Figure 14.3. The message structure used by </B><B>sendmsg</B><B>.</A></B>

<BR>

<P>The fields in the sendmsg message structure give the socket address, size of the socket address, a pointer to the iovector, which contains information about the message to be sent, the length of the iovector, the destination address, and the length of the destination address.

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE>

<IMG SRC="note.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/note.gif" WIDTH = 75 HEIGHT = 46>The sendmsg function uses the message structure to simplify the function call. It also has another advantage: the recvmsg function uses the same structure, simplifying an application's code.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<P>The iovector is an address for an array that points to the message to be sent. The array is a set of pointers to the bytes that comprise the message. The format of the iovector is simple. For each 32-bit address to a memory location with a chunk of the message, a corresponding 32-bit field holds the length of the message in that memory location. This format is repeated until the entire message is specified. This is shown in Figure 14.4. The iovector format enables a noncontiguous message to be sent. In other words, the first part of the message can be in one location in memory, and the rest is separated by other information. This can be useful because it saves the application from copying long messages into a contiguous location.

<BR>

<P><B><A HREF="14tyt04.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/14tyt04.gif">Figure 14.4. The </B><B>iovector</B><B> format.</A></B>

<BR>

<P>The write function takes three arguments: the socket number, the buffer address of the message to be sent, and the length of the message to send. The format of the function call is

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">write(<I>socket</I>, <I>buffer_address</I>, <I>length</I>)</FONT></PRE>

<P>The writev function is similar to write except it uses the iovector to hold the message. This lets it send a message without copying it into another memory address. The format of writev is

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">writev(<I>socket</I>, <I>iovector</I>, <I>length</I>)</FONT></PRE>

<P>where <I>length</I> is the number of entries in iovector.

<BR>

<P>The type of function chosen to send data through a socket depends on the type of connection used and the level of complexity of the application. To a considerable degree, it is also a personal choice of the programmer.

<BR>

<BR>

<A ID="E69E184" NAME="E69E184"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Receiving Data</B></FONT></CENTER></H4>

<BR>

<P>Not surprisingly, because there are five functions to send data through a socket, there are five corresponding functions to receive data: read, readv, recv, recvfrom, and recvmsg. They all accept incoming data from a socket into a reception buffer. The receive buffer can then be transferred from TCP to the application.

<BR>

<P>The read function is the simplest and can be used only when a socket is connected. Its format is

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">read(<I>socket</I>, <I>buffer</I>, <I>length</I>)</FONT></PRE>

<P>The first parameter is the number of the socket or a file descriptor from which to read the data, followed by the memory address in which to store the incoming data, and the maximum number of bytes to be read.

<BR>

<P>As with writev, the readv command enables incoming messages to be placed in noncontiguous memory locations through the use of an iovector. The format of readv is

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">readv(<I>socket</I>, <I>iovector</I>, <I>length</I>)</FONT></PRE>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久婷婷国产综合国色天香| 精品成人一区二区三区四区| 激情综合网av| 亚洲成人免费观看| 国产精品乱码人人做人人爱| 9191精品国产综合久久久久久| 国产高清久久久| 日韩中文字幕亚洲一区二区va在线| 国产精品无码永久免费888| 欧美乱熟臀69xxxxxx| 不卡区在线中文字幕| 国产麻豆日韩欧美久久| 天天免费综合色| 亚洲精品欧美综合四区| 国产精品网站导航| 国产欧美综合色| 精品久久人人做人人爰| 91精品久久久久久久99蜜桃| 在线亚洲免费视频| 99国产精品99久久久久久| 国产剧情一区在线| 蜜桃精品视频在线观看| 午夜视频在线观看一区二区| 亚洲精品国久久99热| 最近日韩中文字幕| 国产精品美女久久久久久久| 国产欧美日韩综合精品一区二区| 精品嫩草影院久久| 精品久久国产字幕高潮| 日韩一级片在线观看| 制服.丝袜.亚洲.另类.中文| 欧美日韩国产综合草草| 欧美性生活影院| 欧美亚洲国产bt| 欧美日韩一区二区三区四区| 欧美日韩色综合| 欧美精三区欧美精三区| 91 com成人网| 欧美一区二区精品在线| 欧美成人video| 久久理论电影网| 国产精品久久久久久妇女6080| 中文字幕在线播放不卡一区| 亚洲欧美电影院| 亚洲国产色一区| 成人av高清在线| av成人免费在线观看| jvid福利写真一区二区三区| 色综合中文字幕| 欧美三级电影在线观看| 欧美一区二区在线看| 欧美成人a视频| 国产日韩欧美高清在线| 国产精品久久影院| 一级日本不卡的影视| 亚洲成av人片在线| 美女视频一区二区三区| 国产精品自拍一区| 波多野结衣视频一区| 在线观看91视频| 日韩视频永久免费| 欧美激情一区二区| 夜夜揉揉日日人人青青一国产精品| 亚洲成a人v欧美综合天堂下载| 美美哒免费高清在线观看视频一区二区| 久久疯狂做爰流白浆xx| 成人永久aaa| 色琪琪一区二区三区亚洲区| 在线综合视频播放| 久久久久97国产精华液好用吗| 一区在线观看免费| 偷拍亚洲欧洲综合| 丁香天五香天堂综合| 欧美三区在线观看| 久久免费视频一区| 亚洲视频一区二区免费在线观看| 日本一区中文字幕| av在线一区二区| 欧美一区二区女人| 亚洲精品国产无天堂网2021| 日本在线不卡视频| 91丨九色丨黑人外教| 日韩一区二区免费视频| 中文字幕一区二区日韩精品绯色| 日韩精品电影在线| www.成人网.com| 91精品国产91热久久久做人人 | 99久久婷婷国产精品综合| 欧美男生操女生| 国产精品久久久久久久久免费相片| 视频一区视频二区中文字幕| 成人在线视频首页| 日韩一区二区三区视频在线观看| 亚洲欧美日本韩国| 国产一区二区三区免费看| 91成人免费在线视频| 国产日韩精品久久久| 日韩精品国产精品| 色哟哟亚洲精品| 久久久久国产精品人| 天天色综合天天| 色88888久久久久久影院按摩| 精品国产一区二区三区久久影院 | 亚洲摸摸操操av| 国内久久婷婷综合| 欧美绝品在线观看成人午夜影视| 一区在线中文字幕| 国产成人午夜精品影院观看视频 | 亚洲天堂福利av| 国产激情视频一区二区三区欧美| 欧美日本一区二区在线观看| 亚洲日本青草视频在线怡红院 | 蜜桃av一区二区三区电影| 欧美婷婷六月丁香综合色| 亚洲欧洲日韩女同| 国产成人激情av| 久久影院视频免费| 狠狠色丁香久久婷婷综合丁香| 6080国产精品一区二区| 亚洲v日本v欧美v久久精品| 91福利区一区二区三区| 亚洲精选在线视频| 日韩欧美的一区| 日韩精品一二三四| 欧美揉bbbbb揉bbbbb| 亚洲国产精品天堂| 欧美日韩电影在线| 亚洲成人777| 91精品午夜视频| 另类综合日韩欧美亚洲| 日韩欧美激情四射| 国精产品一区一区三区mba视频 | 极品美女销魂一区二区三区免费| 国产成人一级电影| 国产欧美日韩另类一区| 一区二区三区日韩在线观看| 99久久精品国产一区二区三区 | 欧美一级欧美一级在线播放| 亚洲一级在线观看| 欧美日韩在线精品一区二区三区激情 | 五月天亚洲婷婷| 欧美卡1卡2卡| 轻轻草成人在线| 久久影院电视剧免费观看| 国产九九视频一区二区三区| 国产女主播视频一区二区| 福利91精品一区二区三区| 国产精品不卡在线| 欧美亚洲日本国产| 蜜臀va亚洲va欧美va天堂| 久久嫩草精品久久久精品一| 国产91综合一区在线观看| 1024亚洲合集| 欧美二区三区91| 韩国三级中文字幕hd久久精品| 国产欧美日韩一区二区三区在线观看 | 石原莉奈在线亚洲三区| 欧美裸体一区二区三区| 精品一区二区三区免费观看| 欧美激情综合五月色丁香小说| 色久综合一二码| 免费日韩伦理电影| 欧美激情一区二区三区不卡| 在线亚洲免费视频| 久久99久久久久久久久久久| 中文字幕中文字幕在线一区| 精品国产a毛片| 成人一级片网址| 亚洲妇熟xx妇色黄| 国产午夜亚洲精品理论片色戒| 91视视频在线直接观看在线看网页在线看| 亚洲一区在线视频| 精品美女一区二区三区| 99久久精品国产一区| 日韩中文字幕一区二区三区| 欧美经典一区二区三区| 欧美日韩中文字幕精品| 国产不卡在线一区| 天堂蜜桃91精品| 亚洲国产精品传媒在线观看| 欧美日韩精品电影| 国产精品一二三在| 亚洲午夜三级在线| 2021中文字幕一区亚洲| 欧美色电影在线| 国产盗摄女厕一区二区三区| 午夜久久电影网| 中文字幕在线不卡一区二区三区| 欧美一区二区观看视频| 一本色道久久综合狠狠躁的推荐 | 在线看国产一区| 极品销魂美女一区二区三区| 亚洲人亚洲人成电影网站色| 日韩精品一区二区在线观看| 色哟哟亚洲精品| kk眼镜猥琐国模调教系列一区二区| 免费成人在线影院| 亚洲韩国一区二区三区| 日韩美女视频19| 久久理论电影网|