锘??xml version="1.0" encoding="utf-8" standalone="yes"?>伊人久久成人,久久一区二区三区av,欧美性色视频在线http://www.shnenglu.com/sscchh-2000/涓庡ぇ瀹朵竴璧峰垎浜煡璇?/description>zh-cnWed, 24 Sep 2025 03:44:11 GMTWed, 24 Sep 2025 03:44:11 GMT60鍏充簬鏃墮棿鐨勫嚑涓彉閲?/title><link>http://www.shnenglu.com/sscchh-2000/archive/2006/12/29/16969.html</link><dc:creator>鍙蹭紶綰?/dc:creator><author>鍙蹭紶綰?/author><pubDate>Fri, 29 Dec 2006 03:07:00 GMT</pubDate><guid>http://www.shnenglu.com/sscchh-2000/archive/2006/12/29/16969.html</guid><wfw:comment>http://www.shnenglu.com/sscchh-2000/comments/16969.html</wfw:comment><comments>http://www.shnenglu.com/sscchh-2000/archive/2006/12/29/16969.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/sscchh-2000/comments/commentRss/16969.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/sscchh-2000/services/trackbacks/16969.html</trackback:ping><description><![CDATA[鏈榪戠湅鍒頒簡鍏充簬鏃墮棿涓婇潰鐨勫嚑涓彉閲忥細timeval,time_t,tm銆傝浜嗚В鐨勮緇嗚璇村畠浠殑瀹氫箟鍜岀浉鍏崇殑璋冪敤鍑芥暟錛岃澶у涓璧鋒潵瀛︿範錛屽懙鍛點?img src ="http://www.shnenglu.com/sscchh-2000/aggbug/16969.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/sscchh-2000/" target="_blank">鍙蹭紶綰?/a> 2006-12-29 11:07 <a href="http://www.shnenglu.com/sscchh-2000/archive/2006/12/29/16969.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Unix緗戠粶緙栫▼絎笁鐗?鍗蜂竴:濂楁帴瀛楄仈緗慉PI瀛︿範絎旇(3)http://www.shnenglu.com/sscchh-2000/archive/2006/05/17/7292.html鍙蹭紶綰?/dc:creator>鍙蹭紶綰?/author>Wed, 17 May 2006 01:42:00 GMThttp://www.shnenglu.com/sscchh-2000/archive/2006/05/17/7292.htmlhttp://www.shnenglu.com/sscchh-2000/comments/7292.htmlhttp://www.shnenglu.com/sscchh-2000/archive/2006/05/17/7292.html#Feedback0http://www.shnenglu.com/sscchh-2000/comments/commentRss/7292.htmlhttp://www.shnenglu.com/sscchh-2000/services/trackbacks/7292.html
涓轟簡甯姪鎴戜滑鐞嗚Вconncet錛宎ccept錛宑lose榪欏嚑涓嚱鏁幫紝浠ュ強浣跨敤netstat宸ュ叿鏉ヨ皟璇昑CP搴旂敤紼嬪簭錛屾垜浠繀欏葷悊瑙CP榪炴帴鏄浣曞緩绔嬪拰緇堟鐨勫拰TCP鐘舵佽漿鎹㈠浘銆?br />

涓夋鎻℃墜

褰撲竴涓猅CP榪炴帴寤虹珛鏃訛紝鍙戠敓浜嗕互涓嬪満鏅細

  1. The server must be prepared to accept an incoming connection. This is normally done by calling socket, bind, and listen and is called a passive open.

  2. The client issues an active open by calling connect. This causes the client TCP to send a "synchronize" (SYN) segment, which tells the server the client's initial sequence number for the data that the client will send on the connection. Normally, there is no data sent with the SYN; it just contains an IP header, a TCP header, and possible TCP options (which we will talk about shortly).

  3. The server must acknowledge (ACK) the client's SYN and the server must also send its own SYN containing the initial sequence number for the data that the server will send on the connection. The server sends its SYN and the ACK of the client's SYN in a single segment.

  4. The client must acknowledge the server's SYN.

鏈灝戦渶瑕佷笁嬈″寘浜ゆ崲錛屽洜姝ょО浣淭CP鐨勪笁嬈℃彙鎵嬶紝濡備笅鍥炬墍紺猴細
鍥劇ず錛毬燭CP 鐨勪笁嬈℃彙鎵?/p>

graphics/02fig02.gif

We show the client's initial sequence number as J and the server's initial sequence number as K. The acknowledgment number in an ACK is the next expected sequence number for the end sending the ACK. Since a SYN occupies one byte of the sequence number space, the acknowledgment number in the ACK of each SYN is the initial sequence number plus one. Similarly, the ACK of each FIN is the sequence number of the FIN plus one.

An everyday analogy for establishing a TCP connection is the telephone system [Nemeth 1997]. The socket function is the equivalent of having a telephone to use. bind is telling other people your telephone number so that they can call you. listen is turning on the ringer so that you will hear when an incoming call arrives. connect requires that we know the other person's phone number and dial it. accept is when the person being called answers the phone. Having the client's identity returned by accept (where the identify is the client's IP address and port number) is similar to having the caller ID feature show the caller's phone number. One difference, however, is that accept returns the client's identity only after the connection has been established, whereas the caller ID feature shows the caller's phone number before we choose whether to answer the phone or not. If the DNS is used (Chapter 11), it provides a service analogous to a telephone book. getaddrinfo is similar to looking up a person's phone number in the phone book. getnameinfo would be the equivalent of having a phone book sorted by telephone numbers that we could search, instead of a book sorted by name.

TCP 閫夐」

Each SYN can contain TCP options. Commonly used options include the following:

  • MSS option. With this option, the TCP sending the SYN announces its maximum segment size, the maximum amount of data that it is willing to accept in each TCP segment, on this connection. The sending TCP uses the receiver's MSS value as the maximum size of a segment that it sends. We will see how to fetch and set this TCP option with the TCP_MAXSEG socket option (Section 7.9).

  • Window scale option. The maximum window that either TCP can advertise to the other TCP is 65,535, because the corresponding field in the TCP header occupies 16 bits. But, high-speed connections, common in today's Internet (45 Mbits/sec and faster, as described in RFC 1323 [Jacobson, Braden, and Borman 1992]), or long delay paths (satellite links) require a larger window to obtain the maximum throughput possible. This newer option specifies that the advertised window in the TCP header must be scaled (left-shifted) by 0鈥?4 bits, providing a maximum window of almost one gigabyte (65,535 x 214). Both end-systems must support this option for the window scale to be used on a connection. We will see how to affect this option with the SO_RCVBUF socket option (Section 7.5).

    To provide interoperability with older implementations that do not support this option, the following rules apply. TCP can send the option with its SYN as part of an active open. But, it can scale its windows only if the other end also sends the option with its SYN. Similarly, the server's TCP can send this option only if it receives the option with the client's SYN. This logic assumes that implementations ignore options that they do not understand, which is required and common, but unfortunately, not guaranteed with all implementations.

  • Timestamp option. This option is needed for high-speed connections to prevent possible data corruption caused by old, delayed, or duplicated segments. Since it is a newer option, it is negotiated similarly to the window scale option. As network programmers there is nothing we need to worry about with this option.

These common options are supported by most implementations. The latter two are sometimes called the "RFC 1323 options," as that RFC [Jacobson, Braden, and Borman 1992] specifies the options. They are also called the "long fat pipe options," since a network with either a high bandwidth or a long delay is called a long fat pipe. Chapter 24 of TCPv1 contains more details on these options.

TCP 榪炴帴鐨勭粓姝?/h4>

TCP寤虹珛鏃墮渶瑕佷笁嬈¢氱煡錛岃岀粓姝竴涓猅CP榪炴帴鏃墮渶瑕佸洓嬈¢氱煡銆?br />One application calls close first, and we say that this end performs the active close. This end's TCP sends a FIN segment, which means it is finished sending data.

  1. The other end that receives the FIN performs the passive close. The received FIN is acknowledged by TCP. The receipt of the FIN is also passed to the application as an end-of-file (after any data that may have already been queued for the application to receive), since the receipt of the FIN means the application will not receive any additional data on the connection.

  2. Sometime later, the application that received the end-of-file will close its socket. This causes its TCP to send a FIN.

  3. The TCP on the system that receives this final FIN (the end that did the active close) acknowledges the FIN.

Since a FIN and an ACK are required in each direction, four segments are normally required. We use the qualifier "normally" because in some scenarios, the FIN in Step 1 is sent with data. Also, the segments in Steps 2 and 3 are both from the end performing the passive close and could be combined into one segment. We show these packets in Figure 2.3.

Figure 2.3. Packets exchanged when a TCP connection is closed.

graphics/02fig03.gif

A FIN occupies one byte of sequence number space just like a SYN. Therefore, the ACK of each FIN is the sequence number of the FIN plus one.

Between Steps 2 and 3 it is possible for data to flow from the end doing the passive close to the end doing the active close. This is called a half-close and we will talk about this in detail with the shutdown function in Section 6.6.

The sending of each FIN occurs when a socket is closed. We indicated that the application calls close for this to happen, but realize that when a Unix process terminates, either voluntarily (calling exit or having the main function return) or involuntarily (receiving a signal that terminates the process), all open descriptors are closed, which will also cause a FIN to be sent on any TCP connection that is still open.

Although we show the client in Figure 2.3 performing the active close, either end鈥攖he client or the server鈥攃an perform the active close. Often the client performs the active close, but with some protocols (notably HTTP/1.0), the server performs the active close.

TCP 鐘舵佽漿鎹㈠浘

鍏充簬TCP榪炴帴鐨勫緩绔嬪拰緇堟鎿嶄綔鍙互鐢變竴涓姸鎬佽漿鎹㈠浘鏉ヨ緇嗚鏄庯紝濡備笅鍥炬墍紺猴細
鍥劇ず錛歍CP 鐘舵佽漿鎹㈠浘
graphics/02fig04.gif

There are 11 different states defined for a connection and the rules of TCP dictate the transitions from one state to another, based on the current state and the segment received in that state. For example, if an application performs an active open in the CLOSED state, TCP sends a SYN and the new state is SYN_SENT. If TCP next receives a SYN with an ACK, it sends an ACK and the new state is ESTABLISHED. This final state is where most data transfer occurs.

The two arrows leading from the ESTABLISHED state deal with the termination of a connection. If an application calls close before receiving a FIN (an active close), the transition is to the FIN_WAIT_1 state. But if an application receives a FIN while in the ESTABLISHED state (a passive close), the transition is to the CLOSE_WAIT state.

We denote the normal client transitions with a darker solid line and the normal server transitions with a darker dashed line. We also note that there are two transitions that we have not talked about: a simultaneous open (when both ends send SYNs at about the same time and the SYNs cross in the network) and a simultaneous close (when both ends send FINs at the same time). Chapter 18 of TCPv1 contains examples and a discussion of both scenarios, which are possible but rare.

One reason for showing the state transition diagram is to show the 11 TCP states with their names. These states are displayed by netstat, which is a useful tool when debugging client/server applications. We will use netstat to monitor state changes in Chapter 5.

瑙傚療鍖咃紙Watching the Packets錛?/h4>

涓嬪湡鏄劇ず浜嗕竴涓猅CP榪炴帴瀹為檯鍙戠敓鐨勫寘浜ゆ崲鎯呭喌錛氳繛鎺ュ緩绔嬶紝鏁版嵁浼犺緭鍜岃繛鎺ョ粓姝€傚湪姣忎竴绔紶杈撶殑鏃跺欙紝涔熺粰鍑轟簡TCP鐘舵併偮?br />TCP 榪炴帴鐨勫寘浜ゆ崲

graphics/02fig05.gif

The client in this example announces an MSS of 536 (indicating that it implements only the minimum reassembly buffer size) and the server announces an MSS of 1,460 (typical for IPv4 on an Ethernet). It is okay for the MSS to be different in each direction (see Exercise 2.5).

Once a connection is established, the client forms a request and sends it to the server. We assume this request fits into a single TCP segment (i.e., less than 1,460 bytes given the server's announced MSS). The server processes the request and sends a reply, and we assume that the reply fits in a single segment (less than 536 in this example). We show both data segments as bolder arrows. Notice that the acknowledgment of the client's request is sent with the server's reply. This is called piggybacking and will normally happen when the time it takes the server to process the request and generate the reply is less than around 200 ms. If the server takes longer, say one second, we would see the acknowledgment followed later by the reply. (The dynamics of TCP data flow are covered in detail in Chapters 19 and 20 of TCPv1.)

We then show the four segments that terminate the connection. Notice that the end that performs the active close (the client in this scenario) enters the TIME_WAIT state. We will discuss this in the next section.

It is important to notice in Figure 2.5 that if the entire purpose of this connection was to send a one-segment request and receive a one-segment reply, there would be eight segments of overhead involved when using TCP. If UDP was used instead, only two packets would be exchanged: the request and the reply. But switching from TCP to UDP removes all the reliability that TCP provides to the application, pushing lots of these details from the transport layer (TCP) to the UDP application. Another important feature provided by TCP is congestion control, which must then be handled by the UDP application. Nevertheless, it is important to understand that many applications are built using UDP because the application exchanges small amounts of data and UDP avoids the overhead of TCP connection establishment and connection termination.

TIME_WAIT 鐘舵?/h3>

姣棤鐤戦棶錛屽叧浜庣綉緇滅紪紼嬩腑鏈璁╀漢璇В鐐逛箣涓灝辨槸 TIME_WAIT聽鐘舵併?鍦ㄤ竴绔皟鐢ㄤ簡close涔嬪悗錛岃绔淮鎸佽繖涓姸鎬佺殑鏃墮棿涓轟袱鍊嶆渶澶ф鐢熷瓨鏃墮棿錛?span class="docEmphasis">maximum segment lifetime (MSL)錛夈?/h3>

Every implementation of TCP must choose a value for the MSL. The recommended value in RFC 1122 [Braden 1989] is 2 minutes, although Berkeley-derived implementations have traditionally used a value of 30 seconds instead. This means the duration of the TIME_WAIT state is between 1 and 4 minutes. The MSL is the maximum amount of time that any given IP datagram can live in a network. We know this time is bounded because every datagram contains an 8-bit hop limit (the IPv4 TTL field in Figure A.1 and the IPv6 hop limit field in Figure A.2) with a maximum value of 255. Although this is a hop limit and not a true time limit, the assumption is made that a packet with the maximum hop limit of 255 cannot exist in a network for more than MSL seconds.

The way in which a packet gets "lost" in a network is usually the result of routing anomalies. A router crashes or a link between two routers goes down and it takes the routing protocols seconds or minutes to stabilize and find an alternate path. During that time period, routing loops can occur (router A sends packets to router B, and B sends them back to A) and packets can get caught in these loops. In the meantime, assuming the lost packet is a TCP segment, the sending TCP times out and retransmits the packet, and the retransmitted packet gets to the final destination by some alternate path. But sometime later (up to MSL seconds after the lost packet started on its journey), the routing loop is corrected and the packet that was lost in the loop is sent to the final destination. This original packet is called a lost duplicate or a wandering duplicate. TCP must handle these duplicates.

There are two reasons for the TIME_WAIT state:

  1. To implement TCP's full-duplex connection termination reliably

  2. To allow old duplicate segments to expire in the network

The first reason can be explained by looking at Figure 2.5 and assuming that the final ACK is lost. The server will resend its final FIN, so the client must maintain state information, allowing it to resend the final ACK. If it did not maintain this information, it would respond with an RST (a different type of TCP segment), which would be interpreted by the server as an error. If TCP is performing all the work necessary to terminate both directions of data flow cleanly for a connection (its full-duplex close), then it must correctly handle the loss of any of these four segments. This example also shows why the end that performs the active close is the end that remains in the TIME_WAIT state: because that end is the one that might have to retransmit the final ACK.

To understand the second reason for the TIME_WAIT state, assume we have a TCP connection between 12.106.32.254 port 1500 and 206.168.112.219 port 21. This connection is closed and then sometime later, we establish another connection between the same IP addresses and ports: 12.106.32.254 port 1500 and 206.168.112.219 port 21. This latter connection is called an incarnation of the previous connection since the IP addresses and ports are the same. TCP must prevent old duplicates from a connection from reappearing at some later time and being misinterpreted as belonging to a new incarnation of the same connection. To do this, TCP will not initiate a new incarnation of a connection that is currently in the TIME_WAIT state. Since the duration of the TIME_WAIT state is twice the MSL, this allows MSL seconds for a packet in one direction to be lost, and another MSL seconds for the reply to be lost. By enforcing this rule, we are guaranteed that when we successfully establish a TCP connection, all old duplicates from previous incarnations of the connection have expired in the network.

There is an exception to this rule. Berkeley-derived implementations will initiate a new incarnation of a connection that is currently in the TIME_WAIT state if the arriving SYN has a sequence number that is "greater than" the ending sequence number from the previous incarnation. Pages 958鈥?59 of TCPv2 talk about this in more detail. This requires the server to perform the active close, since the TIME_WAIT state must exist on the end that receives the next SYN. This capability is used by the rsh command. RFC 1185 [Jacobson, Braden, and Zhang 1990] talks about some pitfalls in doing this.

涓鑸綉緇滅▼搴忔墍浣跨敤鐨勫崗璁?/h3>

涓嬪浘鎬葷粨浜嗕竴浜涳細

Figure 2.19. Protocol usage of various common Internet applications.

graphics/02fig19.gif

The first two applications, ping and traceroute, are diagnostic applications that use ICMP. traceroute builds its own UDP packets to send and reads ICMP replies.

The three popular routing protocols demonstrate the variety of transport protocols used by routing protocols. OSPF uses IP directly, employing a raw socket, while RIP uses UDP and BGP uses TCP.

The next five are UDP-based applications, followed by seven TCP applications and four that use both UDP and TCP. The final five are IP telephony applications that use SCTP exclusively or optionally UDP, TCP, or SCTP.



]]>姣嶄翰鑺傚揩鍒頒簡錛屽啓鐐逛笢瑗塊佺粰姣嶄翰http://www.shnenglu.com/sscchh-2000/archive/2006/05/12/7011.html鍙蹭紶綰?/dc:creator>鍙蹭紶綰?/author>Fri, 12 May 2006 06:10:00 GMThttp://www.shnenglu.com/sscchh-2000/archive/2006/05/12/7011.htmlhttp://www.shnenglu.com/sscchh-2000/comments/7011.htmlhttp://www.shnenglu.com/sscchh-2000/archive/2006/05/12/7011.html#Feedback20http://www.shnenglu.com/sscchh-2000/comments/commentRss/7011.htmlhttp://www.shnenglu.com/sscchh-2000/services/trackbacks/7011.html聽聽聽聽聽聽2000騫撮偅騫達紝鎴戣冧笂浜嗗悏鏋楀ぇ瀛︼紝姣嶄翰鍝簡銆傛垜鎯蟲瘝浜蹭篃鏄拰鎴戜竴鏍鳳紝鏈熷緟鐫榪欎釜姊︽兂錛岃岀湡姝e疄鐜頒簡鐨勬椂鍊欙紝鎴戜滑閮芥姂鍒朵笉浜嗛偅涓枩鎮(zhèn)︾殑蹇冩儏銆傛垜鎯蟲瘝浜蹭竴瀹氭劅鍒板緢騫哥錛屽ス浼氭劅鍒板緢楠勫偛鐨勩傚彲鑳芥湁浜涗漢浼氭兂錛岃冧簡澶у鏈変粈涔堜簡涓嶈搗鐨勶紝鐜板湪鐨勫ぇ瀛︾敓璺熸皯宸ヤ竴鏍鳳紝鍒板閮芥槸銆備篃娌℃湁浠涔堝ソ楠勫偛鐨勫惂銆傚彲鏄紝鍦ㄨ繖閲屾垜瑕佸憡璇変綘錛屾垜浠偅涓潙錛岀敋鑷抽偅涓埂錛屽湪鎴戠殑璁板繂涓紝灝卞嚭鏉ヨ繖鏍蜂竴涓ぇ瀛︾敓錛岄偅宸茬粡鏄笂涓笘綰叚涓冨崄騫翠唬鐨勪簨鎯呬簡錛屼篃灝辨槸鍦ㄤ腑闂撮殧浜嗚繎30騫翠簡銆備綘鍙互鎯寵薄閭f牱鐨勫満鏅傛瘝浜茶兘涓嶉獎鍌插槢錛熷叾瀹炴瘝浜茬殑綆℃暀鐜板湪鎯蟲潵錛屼笉鏄肩潃璁╂垜瀛︿範錛岃屾槸璁╂垜鑷敱鐨勫彂灞曪紝璇磋搗鏉ヤ篃鎬紝灝忔椂鍊欐垜鍙槸涓涓潪甯歌皟鐨殑瀛╁瓙錛屾暣澶╁拰浼欎即浠帺鐨勫緢鐤傚埌澶勪笅娌蟲崏楸鹼紝涓婃爲鎺忛笩紿濄傚嚒鏄兘鐜╃殑閮界帺浜嗐傝繖鍙兘璺熸瘝浜茬殑璦浼犺韓鏁欐湁鍏崇郴鐨勩傝〃濮愪篃鏇鵑棶榪囨垜錛氣滃皬鏃跺欏ぇ瀹墮兘鏄竴璧風(fēng)帺鐨勶紝鐢氳嚦姣旀垜榪樼敤鍔燂紝鎬庝箞鎴戞病鏈夎冧笂澶у浣犲幓鑰冧笂浜嗗憿錛熲濇垜涔熷紑鐜╃瑧鐨勫洖絳旓細鍏跺疄鎴戠帺鐨勬椂鍊欙紝澶磋剳榪樻槸鍦ㄦ濊冧笢瑗垮憿銆傚叾瀹炶〃濮愪篃鏄竴涓緢浼樼鐨勶紝鍙槸鐢變簬瀹跺涵鐨勫師鍥狅紝瀹炲湪澶┓浜嗭紝涓婂畬浜嗗垵涓氨娌℃湁涓婂浜嗐傝鍒拌繖閲岋紝鍏跺疄鍦ㄦ垜浠潙閲岋紝鎴栬呬換浣曚竴涓傳絀風(fēng)殑鍐滄潙錛屾垜浠繖浜涘瀛愪笉鏄錛岃屾槸鐪熸鐢變簬瀹墮噷瀛╁瓙澶氾紝鍙堥潪甯歌傳絀鳳紝鍙堣璁╂瘡涓瀛愰兘鑳借鐐逛功錛岃涓婂嚑涓瓧銆傛墍浠ュぇ閮ㄥ垎鐨勪漢閮藉彧鑳借鍒板垵涓敋鑷沖皬瀛︽病鏈夋瘯涓氬氨杈嶅浜嗐傛墍浠ユ垜瑙夊緱姣嶄翰闅捐兘鍙吹鐨勶紝灝辨槸濂圭殑鍧氭寔錛屽洜涓哄湪鎴戝垵涓夐偅騫存瘯涓氱殑鏃跺欙紝鐢變簬鑰冭瘯鎴愮嘩涓嶇悊鎯籌紝瑕佽楂樹腑榪橀渶瑕佷氦浜斿崈鍧楅挶鐨勬墿鎷涜垂銆傞偅涓椂鍊欑湡鏄潪甯歌壈闅劇殑涓姝ャ傜湡鍙互鐢ㄦ憯閿呭崠閾佹潵褰㈠銆傛墍浠ユ垜寰堟劅璋㈡瘝浜插湪閭d箞鍥伴毦鐨勬椂鍊欒兘澶熷挰鐗欐拺榪囨潵浜嗐傚綋鐒跺湪榪欓噷榪樿鎰熻阿鎴戠殑騫茬埜騫插銆傛病鏈変粬浠殑澶у姏鏀寔鎴戜篃寰堥毦璧板埌榪欎竴姝ャ?br />聽聽聽聽聽聽9鏈堜喚錛屾垜紱誨紑浜嗙敓鎴戝吇鎴戠殑閭d釜璐槧鐨勫啘鏉戯紝涓磋蛋鐨勬椂鍊欙紝鎴戞鎻g潃鍏崈鍧楅挶韙忓線闀挎槬鐨勫垪杞︿笂銆傚叓鍗冨潡閽遍噷闈㈢幇鍦ㄨ繕娓呮鐨勮寰楋細鍙斿彅鍊熺殑涓ゅ崈錛岃垍鑸呭熺殑涓鍗冿紝琛ㄥ摜鍊熺殑涓鍗冧簲錛岃繕鏈夊Ж鍝ュ熺殑涓鍧楀拰濮ㄥ鍊熺殑浜旂櫨銆傚墿涓嬬殑涓ゅ崈鏄翰鏈嬪ソ鍙嬫潵鍜屽枩閰掔粰鐨勩備粠姝ゅ紑濮嬩簡鎴戝湪闀挎槬鐨勬眰瀛︿箣璺備篃灝辨槸鎴戞潵鍒伴暱鏄ヤ箣鍚庣殑涓や釜鏈堝乏鍙籌紝鐖朵翰鍜屾瘝浜蹭篃鍘諱簡涓婃搗銆傜洰鐨勫氨鏄墦宸ョ粰鎴戞專鏉ュ勾鐨勫璐廣傝鐭ラ亾浜叉垰瀹墮噷鐨勭敓媧諱篃騫朵笉濂斤紝鑳芥敮鍔╂垜榪欎箞澶氶挶璇諱功瀹炲湪涓嶆槗浜嗐備笅涓騫寸殑瀛﹁垂褰撶劧涓嶅彲鑳斤紝涔熶笉濂芥剰鎬濆紶鍙d簡銆傚厛寮濮嬭璇存垜鐨勭埗姣嶅惂錛屾潵鍒頒簡涓婃搗錛屼粬浠湡鐨勪笉瀹規(guī)槗銆傚湪鑰佷埂鐨勫府鍔╀笅錛屽緢蹇埗姣嶄究寮濮嬩簡絎竴浠藉伐浣溿傛瘝浜插湪涓涓彍甯傚満閲岄潰甯埆浜哄崠楦¢腑錛屽紱界瓑錛屼竴涓湀500鍧楅挶銆傝璧鋒潵榪欎釜鍙兘鐪嬩笂鍘誨茍涓嶆庝箞澶緵鑻︺備絾鏄垜瑕佽榪欎釜宸ヤ綔鎴戞瘝浜插挰鐗欏潥鎸佷簡涓や釜鏈堟渶緇堣緸鍘諱簡銆備負浠涔堝憿錛熸瘝浜叉瘡澶╂棭涓?鐐瑰氨璧峰簥錛岀劧鍚庡埌鑿滃競鍦哄幓錛岃繖涓椂鍊欐湁涓杞﹁揣錛岀敱浜庤彍甯傚満鏄湪浜屾ゼ錛屾瘝浜詫紙榪樻湁鍙﹀涓涓樋濮紝鐢熸椿涔熶竴瀹氫笉鏄擄紝鍚﹀垯鏍規(guī)湰涓嶅彲鑳芥潵榪欎釜鍦版柟錛変粬浠咯灝變竴涓張涓涓弧杞藉紱界殑綃瓙寰浜屾ゼ涓婇潰鐖傝繖鏍蜂竴涓灝忔椂鍊欎箣鍚庡氨寮濮嬬粰搴椾富鍗栵紝鐒跺悗鎶婁竴鍙張涓鍙殑瀹剁瀹版潃錛岀劧鍚庡幓鐨紝媧楀共鍑銆傚氨榪欐牱涓孌墊椂闂達紝姣嶄翰鏁翠釜浜鴻偪鐨勪笉鎴愭牱瀛愪簡錛屾墜鐨浜嗕竴灞傚張涓灞傘傚洜涓哄疄鍦ㄦ尯涓嶄綇浜嗭紝鍘誨尰闄㈡不鐤椼傜粨鏋滆緵鑻︽專浜嗕竴鐐歸挶鍑犱箮閮界敤鍦ㄤ簡鍖葷枟璐逛笂闈簡銆傚啀鏉ヨ璇寸埗浜插惂錛岀埗浜茬殑絎竴浠藉伐浣滄槸閫佽揣錛屽氨鏄偅涓剼韞笁杞濺錛屾瘡澶╅佸ソ鍑犳錛屾瘡嬈℃湁濂藉嚑鐧炬枻錛屾湁鏃跺欒兘杈懼埌涓婂崈鏂ゃ備竴涓湀涔熷氨鍏竷鐧懼潡閽便傚氨榪欐牱涔熸尯浜嗗嚑涓湀渚胯緸浜嗐傛垜榪樻湁涓涓濡癸紝鐖舵瘝榪欐澶栧嚭鎵撳伐錛屼笉浠呬粎鏄負浜嗘垜涓涓漢鐨勬眰瀛︺傚洜涓烘垜濡瑰涔熼珮涓浜嗭紝鐖舵瘝涓嶄粎浠呰渚涙垜涓涓漢銆?br />聽聽聽聽聽聽鏉ュ埌浜嗛暱鏄ワ紝涓鍒囬兘鏄偅涔堟柊濂囷紝鐪嬪埌浜嗗ぇ瀛︾敓媧葷湡鐨勬槸澶嚜鐢變簡銆傛病鏈夎佸笀鐨勭鏉熴備篃璁告槸鎴戠殑鐞嗘兂錛屼篃璁告槸榪欐潵涔嬫槗鐨勬眰瀛︽満浼氾紝鎴戜粛鐒舵兂鍦ㄩ珮涓偅鏍鳳紝鍔姏瀛︿範錛屽洜涓烘垜鐨勭悊鎯蟲槸瑕佽鐖舵瘝榪囦笂騫哥鐨勭敓媧伙紝涓嶅啀閭d箞鎿嶅姵銆傝涔℃潙浠兘鑳藉榪囦笂騫哥鐨勭敓媧匯傛墍浠ユ垜蹇呴』鍔姏瀛︿範錛屾潵瀛︿範鍒扮湡姝g殑鏈錛岃繖鏍鋒墠鏈夊笇鏈涖傝鎴戞剰澶栫殑鏄紝絎竴騫寸粨鏉熶箣鍚庯紝鎴戠珶鐒惰幏寰椾簡濂栧姪瀛﹂噾鍏?700鍧楅挶銆傝繕璁板緱褰撴椂鎴戠畝鐩翠笉鏁㈢浉淇¤繖鏄湡鐨勩傝繖鍙槸闇瑕佹瘝浜叉棩鏃ュ澶滄嫾鍛芥專涓婁竴騫村晩錛佹垜涓嶇煡閬撹璇翠粈涔堝ソ錛屽彧鑳芥劅璋㈠鏍″鎴戠殑鍏蟲銆傚氨榪欐牱錛屾垨璁告槸鍙楀埌浜嗘縺鍔憋紝鎴栬鎴戠湡鐨勫緢浼樼銆傛暣涓ぇ瀛﹀洓騫存垜涓鍏辮幏寰椾簡濂栧姪瀛﹂噾鍏?6錛?00鍧楅挶錛堝叾涓瀛﹂噾12錛?00錛夈傚啀鍔犱笂涓浗宸ュ晢閾惰璐鋒14錛?00銆備嬌鎴戦『鍒╃殑瀹屾垚浜嗗ぇ瀛﹀洓騫寸殑瀛︿笟銆傞櫎浜嗗涓氫箣澶栥傛垜榪樼敤涓閮ㄥ垎閽辨敮鍔╂垜濡瑰璇諱功銆傚彟澶栫敱浜庣埛鐖峰ザ濂跺勾綰ぇ浜嗭紝鐖稿浠栦滑鍙堜笉鍦ㄨ韓杈廣傛垜涔熺粰浠栦滑瀵勮繃鍑犳鐢熸椿璐廣傝繕璁扮潃鏈澶氫竴嬈℃槸500錛岄偅鏃跺欑埛鐖風(fēng)敓鐥呬簡錛岄渶瑕佷綇闄€傛澶栫敱浜庣埜濡堝湪澶栨墦宸ワ紝澶у浠栦滑緇欐垜瀹剁鍦般傛垜涔熷瘎榪囧嚑鐧懼潡閽便傚悓鏃朵篃綆楁槸鍑忚交浜嗙埜濡堜粬浠殑涓鐐硅礋鎷呭惂銆傛暣涓ぇ瀛︾敓媧昏繃寰楀緢鍏呭疄錛屾洿璁╂垜騫歌繍鐨勬槸錛岄亣鍒頒簡涓涓鎴戞湁鐭ラ亣涔嬫仼鐨勮佸笀錛屼篃灝辨槸鎴戠幇鍦ㄧ殑瀵煎笀闄堣佸笀錛屼粬瀵規(guī)垜鐢熸椿鍜屽涔犱笂鐨勫府鍔╄鎴戞劅嬋涓嶅敖錛涜屼笖鎴戣繕閬囧埌浜嗕竴涓氭儏杈劇悊錛岃壈鑻︽湸绱犺屽張鍗佸垎婕備寒鐨勫コ瀛╋紝涔熷氨鏄垜鐨勫コ鏈嬪弸闇栭湒錛岃繖鍑犲勾鏉ョ湡鐨勫緢鎰熻阿濂圭殑鐞嗚В鍜屾敮鎸併?br />聽聽聽聽聽聽涓嶄絾鎴戣幏寰椾簡榪欎箞澶氱殑騫歌繍銆傛垜鐨勫濡逛篃鏄垢榪愮殑銆傜敱浜庢垜鍦ㄥ鏍″拰鍥藉鐨勬敮鍔╀笅瀹屾垚浜嗗涓氾紝鎴戠埜濡堣緵鑻︽專鐨勯挶灝辮兘澶熶緵鎴戝濡硅涔︿簡銆傜幇鍦ㄦ垜濡瑰宸茬粡蹇瘯涓氫簡錛岀洰鍓嶅湪瀹炰範涓紝铏界劧姣忔湀900鍧楅挶錛屼絾涔熸槸鐩稿綋涓嶉敊浜嗐傝屾槸鐜板湪榪樻湁涓騫村氨姣曚笟浜嗭紝鐢變簬姣旇緝騫歌繍錛岃鐨勬槸鍏垂銆傛瘡涓湀榪樿兘鏈夊叓涔?jié)鐧惧潡閽辩殑鐢煁z昏ˉ鍔┿備粠鑰岃兘璁╃埗姣嶄粬浠笉瑕侀偅涔堟搷鍔充簡銆?br />聽聽聽聽聽聽鍙槸錛屽氨鍦ㄥ墠涓ゅぉ錛屾垜鐖哥埜璺熸垜璇存垜姣嶄翰鍙堝幓浠嬬粛鎵鑺變簡100鍧楅挶鎵句簡涓浠藉伐浣溿傛瘝浜茬殑宸ヤ綔鏄粰涓瀹跺尰闄㈡礂鑿滐紝鍒風(fēng)錛屾墦鏉備粈涔堢殑銆備竴涓湀700鍧楅挶錛屾瘡澶╂棭涓婂叚鐐瑰埌鏅氫笂涔?jié)鐐广傛垜鏄ㄥぉ鏅氫笂緇欐瘝浜叉墦浜嗕竴涓數(shù)璇濓紝絳夊埌蹇節(jié)鐐瑰崐鎵嶆壘鍒版瘝浜茬殑銆傛垜鍧氬喅瑕佹眰姣嶄翰杈炴帀宸ヤ綔錛屽彲鏄瘝浜插氨璇撮棽鐫嫻戣韓涔熸槸鐤鹼紝榪樹笉濡傚繖鐐瑰憿銆備竴涓皬鏃惰繕涓嶅埌2鍧楅挶錛屾瘝浜茶繕鏄偅鏍風(fēng)殑涔愯銆傛垜鐪熺殑涓嶇煡閬撴庝箞鏍峰姖鎵嶈兘鍔濆ス杈炴帀榪欎喚宸ヤ綔銆?br />聽聽聽聽聽聽鍏跺疄姣嶄翰鐨勮韓浣撳茍涓嶅ソ錛屽湪鎴戜笂楂樹腑鐨勬椂鍊欙紝姣嶄翰涓嬪湴騫叉椿绱嚭浜嗚倽鐐庯紝鏈鍚庢葷畻娌誨ソ浜嗭紝浣嗘槸涔熶笉鑳藉お鍔崇瘡銆傝屼笖姣嶄翰鐜板湪榪樻湁瀛愬鑲岀槫錛岃櫧鐒舵槸鑹х殑錛屼絾鏄篃鎬誨嚭琛甯︽潵浜嗚韓浣撶殑涓ラ噸璐銆傛垜濠跺┒璺熸垜璇達細鈥滀綘濡堟湁鐥呬綘鍜屼綘濡瑰鎬庝箞涓嶈濂規(guī)不鍟婏紝鍒漢鏈夌梾閮芥不錛屽ス鏈夌梾鐣欑潃錛岀湡鏄鎬傗濆叾瀹炴垜濡堜篃鎯蟲不錛屼笉榪囧嵈璇達細鈥滅瓑浣犱咯涓婄彮鎸i挶浜嗗啀娌伙紝鐜板湪鍘誨尰闄篃媯鏌ヤ簡錛岃涓嶈绱э紝鑰屼笖鎵嬫湳璐逛篃寰楀叚涓冨崈錛屾牴鏈篃娌℃湁閽辨不銆傗濓紝涓涓漢鐨勫姏閲忕湡鐨勬槸閭d箞鐨勫井寮卞晩銆傛垜鍙兘鐩兼湜鎴戞棭鐐規(guī)瘯涓氾紝鍘繪專閽辯粰姣嶄翰娌葷梾銆傛垜鍦ㄨ繖閲岃璇達細鈥滃錛屾垜鐖變綘錛屾槸浣犵殑鍧氬己鏀拺浜嗚繖涓搴紝璁╂垜浠劅鍒頒簡鎮(zhèn)ㄤ紵澶х殑姣嶇埍錛佲濄?br />聽聽聽聽聽聽鐪嬪埌浜嗘垜鐨勬晠浜嬶紝鎴戝笇鏈涙瘡涓涓悜鎴戣繖鏍風(fēng)殑絀蜂埂濞冮兘鑳藉鏈変竴棰楀鏂楃殑蹇冿紝鏉ユ敼鍙樻垜浠殑鐢熸椿銆傞兘鑳藉娣辯埍鐫鑷繁鐨勬瘝浜詫紝鑳藉鏈熷緟鐫鏄庡ぉ緹庡ソ鐨勭敓媧?..

]]>
Unix緗戠粶緙栫▼絎笁鐗?鍗蜂竴:濂楁帴瀛楄仈緗慉PI瀛︿範絎旇(2)http://www.shnenglu.com/sscchh-2000/archive/2006/05/10/6860.html鍙蹭紶綰?/dc:creator>鍙蹭紶綰?/author>Wed, 10 May 2006 03:13:00 GMThttp://www.shnenglu.com/sscchh-2000/archive/2006/05/10/6860.htmlhttp://www.shnenglu.com/sscchh-2000/comments/6860.htmlhttp://www.shnenglu.com/sscchh-2000/archive/2006/05/10/6860.html#Feedback0http://www.shnenglu.com/sscchh-2000/comments/commentRss/6860.htmlhttp://www.shnenglu.com/sscchh-2000/services/trackbacks/6860.html璇ヨ妭涓昏灞曠ず涓涓畝鍗曠殑[鏃ユ湡鏃墮棿]鏈嶅姟鍣ㄧ殑紼嬪簭紺轟緥.
摟1.3 涓涓畝鍗曠殑鏃ユ湡鏃墮棿鏈嶅姟鍣ㄧ▼搴忎唬鐮?br />聽聽聽榪欎釜鏈嶅姟鍣ㄧ▼搴忓彲浠ヤ負涓婁竴鑺傜殑瀹㈡埛绔彁渚涙湇鍔°?br />

 1 #include     "unp.h"
2 #include <time.h>
3 int
4 main(int argc, char **argv)
5 {
6 int listenfd, connfd;
7 struct sockaddr_in servaddr;
8 char buff[MAXLINE];
9 time_t ticks;
10 listenfd = Socket(AF_INET, SOCK_STREAM, 0);
11 bzeros(&servaddr, sizeof(servaddr));
12 servaddr.sin_family = AF_INET;
13 servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
14 servaddr.sin_port = htons(13); /* daytime server */
15 Bind(listenfd, (SA *) &servaddr, sizeof(servaddr));
16 Listen(listenfd, LISTENQ);
17 for ( ; ; ) {
18 connfd = Accept(listenfd, (SA *) NULL, NULL);
19 ticks = time(NULL);
20 snprintf(buff, sizeof(buff), "%.24s\r\n", ctime(&ticks));
21 Write(connfd, buff, strlen(buff));
22 Close(connfd);
23 }
24 }

浜х敓涓涓猅CP濂楁帴瀛?/h4>

10 鍒涘緩涓涓猅CP濂楁帴瀛楋紝涓庡鎴風(fēng)涓鏍楓?/h4>

緇戝畾鏈嶅姟鍣ㄧ殑騫夸負浜虹煡鐨勭鍙e埌璇ュ鎺ュ瓧

11鈥?5 鏈嶅姟鍣ㄩ氳繃濉厖緗戠粶濂楁帴瀛楃粨鏋勪綋涓殑绔彛鍩燂紝浠ュ強鏈嶅姟鍣ㄧ殑緗戠粶鎺ュ彛錛圛P鍦板潃錛夛紝鐒跺悗榪涜緇戝畾錛堣皟鐢╞ind錛夈傚湪榪欓噷鎸囧畾IP鍦板潃涓篒NADDR_ANY錛屼負浜嗚瀹㈡埛绔彲浠ヨ繛鎺ユ湇鍔″櫒鐨勪換涓緗戠粶鎺ュ彛錛堝洜涓烘湇鍔″櫒鍙兘鏈夊鍧楃綉鍗★紝涔熷氨瀵瑰簲浜嗗涓狪P鍦板潃錛夛紝涔熷氨鏄濡傛灉鏈嶅姟鍣ㄦ湁涓や釜IP鍦板潃錛屽鎴風(fēng)榪炴帴浠諱竴IP鍦板潃鍗沖彲銆傚悗緇珷鑺備腑浠嬬粛浜嗗浣曢檺鍒跺鎴風(fēng)榪炴帴鍒頒竴涓浐瀹氱殑鎺ュ彛涓娿?/p>

杞崲涓虹洃鍚鎺ュ瓧

16 閫氳繃璋冪敤listen錛屼竴涓鎺ュ瓧灝辮漿鎹負鐩戝惉濂楁帴瀛楋紝榪欏氨鏄璇ュ鎺ュ瓧璐熻矗鎺ユ敹鏉ヨ嚜瀹㈡埛绔殑榪炴帴璇鋒眰錛岃屽茍涓嶇湡姝d笌瀹㈡埛绔繘琛屼俊鎭紶杈撱?br />甯擱噺LISTENQ 鏄湪澶存枃浠?tt>unp.h涓畾涔夌殑錛屽畠鏄寚鑳藉鍚屾椂鐩戝惉瀹㈡埛绔繛鎺ョ殑涓暟銆備笉瓚呰繃LISTENQ鐨勫鎴風(fēng)鍚屾椂榪炴帴鏈嶅姟鍣紝瀹冧滑浼氬湪涓涓槦鍒椾腑鎺掗槦錛屾潵絳夊緟鏈嶅姟鍣ㄧ殑澶勭悊銆傚悗緇珷鑺傛湁鏇磋緇嗙殑璁ㄨ銆?br />
鎺ユ敹瀹㈡埛绔繛鎺ワ紝鍙戦佸洖澶?/p>

17鈥?1 涓鑸湴錛屾湇鍔″櫒榪涚▼鍦ㄨ皟鐢╝ccept涔嬪悗榪涘叆鍒扮潯鐪犵姸鎬侊紝絳夊緟鐫瀹㈡埛绔湴榪炴帴璇鋒眰. 涓涓猅CP榪炴帴閫氳繃涓涓О涓轟笁鏂規(guī)彙鎵嬫潵寤虹珛錛屽綋涓夋柟鎻℃墜瀹屾垚涔嬪悗錛宎ccept璋冪敤榪斿洖銆傝繑鍥炲兼槸涓涓柊鐨勫鎺ュ瓧鎻忚堪絎︼紙涓涓暣鏁板糲onnfd錛夛紝榪欎釜鏂扮殑濂楁帴瀛楄礋璐d笌瀹㈡埛绔繘琛岄氳銆傚浜庢瘡涓涓鎴風(fēng)鍦拌繛鎺ワ紝accept閮借繑鍥炰竴涓柊鐨勫鎺ュ瓧鎻忚堪絎︺傛暣鏈功浣跨敤鐨勬棤闄愬驚鐜鏍兼槸榪欐牱鐨勶細

				
for ( ; ; ) {
    . . .
}
				

褰撳墠鏃墮棿鍜屾棩鏈熼氳繃璋冪敤搴撳嚱鏁皌ime鏉ヨ幏寰楋紝騫朵笖閫氳繃璋冪敤ctime榪涜杞崲錛屼嬌寰楁垜浠兘澶熺洿瑙傜殑闃呰銆傚涓嬶細
Mon May 26 20:58:40 2003

緇堟榪炴帴

22 瀹㈡埛绔皟鐢╟lose涔嬪悗錛屾湇鍔″櫒鍏抽棴榪炴帴銆傝繖鏃跺欏紩璧蜂簡涓涓猅CP榪炴帴緇堟搴忓垪錛氫竴涓狥IN鍙戦佸埌姣忎竴绔紝鍚屾椂姣忎竴涓狥IN閮借琚彟涓绔‘璁ゃ傚湪鍚庨潰绔犺妭涓皢浼氬TCP榪炴帴寤虹珛鏃跺欑殑涓夋柟鎻℃墜浠ュ強TCP榪炴帴緇堟鏃跺欑殑鍥涘寘浜ゆ崲鏈夋洿璇︾粏鐨勮璁恒?br />聽聽聽浠ヤ笂緇欏嚭鐨勫鎴風(fēng)鍜屾湇鍔″櫒鐗堟湰閮芥槸鍗忚鐩稿叧鐨勶紙IPv4錛夛紝鍦ㄥ悗闈㈠皢浼氱粰鍑轟竴涓崗璁棤鍏崇殑鐗堟湰錛圛Pv4鍜孖Pv6閮介傜敤錛屼富瑕侀氳繃浣跨敤getaddrinfo鍑芥暟錛夈?br />聽聽聽鏈鍚庨渶瑕佽ˉ鍏呯殑涓鐐規(guī)槸錛屽湪浠ヤ笂娑夊強鍒癝ocket API璋冪敤鐨勬椂鍊欙紝姣忎釜鍑芥暟鐨勭涓涓瓧姣嶅彉鎴愪簡澶у啓錛屽叾鎰忎箟鍜屽皬鍐欏紑澶寸殑鏄竴鏍風(fēng)殑錛屽彧涓嶈繃澶氫簡涓涓敊璇鐞嗙艦浜嗐?/p>

]]>
err_寮澶寸殑鑷畾涔夊嚱鏁?/title><link>http://www.shnenglu.com/sscchh-2000/archive/2006/05/09/6838.html</link><dc:creator>鍙蹭紶綰?/dc:creator><author>鍙蹭紶綰?/author><pubDate>Tue, 09 May 2006 13:39:00 GMT</pubDate><guid>http://www.shnenglu.com/sscchh-2000/archive/2006/05/09/6838.html</guid><wfw:comment>http://www.shnenglu.com/sscchh-2000/comments/6838.html</wfw:comment><comments>http://www.shnenglu.com/sscchh-2000/archive/2006/05/09/6838.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/sscchh-2000/comments/commentRss/6838.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/sscchh-2000/services/trackbacks/6838.html</trackback:ping><description><![CDATA[ <table cellspacing="0" cellpadding="0" width="100%" border="0"> <tbody> <tr> <td valign="top"> <h3 class="docSection1Title" id="162666-841">D.3 Standard Error Functions</h3> <p class="docText">We define our own set of error functions that are used throughout the text to<br />聽handle error conditions. The reason for using our own error functions is to <br />let us write our error handling with a single line of C code, as in</p> <pre> </pre> <pre>if <span id="hvzpftn" class="docEmphasis">(error condition)</span> err_sys <span id="hvzpftn" class="docEmphasis">(printf format with any number of arguments)</span>; </pre> <pre> </pre> <p class="docText">instead of</p> <pre> </pre> <pre>if <span id="hvzpftn" class="docEmphasis">(error condition)</span> { char buff [2002]; snprintf(buff, sizeof (buff), <span id="hvzpftn" class="docEmphasis">printf format <br />聽聽聽 with any number of arguments)</span>; perror(buff); exit (1); } </pre> <pre> </pre> <p class="docText">Our error functions use the variable-length argument list facility from <tt>ANSI C</tt>. <br />See Section 7.3 of [Kernighan and Ritchie 1988] for additional details.</p> <p class="docText"> <a class="docLink" href="mk:@MSITStore:E:\study_magizine\UNIX%20Network%20Programming%20Volume[1].1%20The%20Sockets%20Networking%20API.chm::/0131411551_app04lev1sec3.html#app04fig03"> <font color="#002c99">Figure D.3</font> </a>lists the differences between the various error functions. <br />If the global integer <tt>daemon_proc</tt> is nonzero, the message is passed to<br /><tt>syslog</tt> with the indicated level; otherwise, the error is output to standard error.<br />Figure D.3. Summary of our standard error functions.<br /><img id="132235130214" height="138" alt="graphics/xdfig03.gif" src="mk:@MSITStore:E:\study_magizine\UNIX%20Network%20Programming%20Volume[1].1%20The%20Sockets%20Networking%20API.chm::/FILES/xdfig03.gif" width="367" border="0" /></p> <p class="docText"> <a class="docLink" href="mk:@MSITStore:E:\study_magizine\UNIX%20Network%20Programming%20Volume[1].1%20The%20Sockets%20Networking%20API.chm::/0131411551_app04lev1sec3.html#app04fig04"> <font color="#002c99">Figure D.4</font> </a>shows the first five functions from <a class="docLink" href="mk:@MSITStore:E:\study_magizine\UNIX%20Network%20Programming%20Volume[1].1%20The%20Sockets%20Networking%20API.chm::/0131411551_app04lev1sec3.html#app04fig03"><font color="#002c99">Figure D.3</font></a>.</p> <h5 class="docExampleTitle"> <a name="app04fig04"> </a>Figure D.4 Our standard error functions.</h5> <p class="docText"> <span id="hvzpftn" class="docEmphasis">lib/error.c</span> </p> <pre> 1 #include "unp.h" 2 #include <stdarg.h> /* ANSI C header file */ 3 #include <syslog.h> /* for syslog() */ 4 int daemon_proc; /* set nonzero by daemon_init() */ 5 static void err_doit(int, int, const char *, va_list); 6 /* Nonfatal error related to system call 7 * Print message and return */ 8 void 9 err_ret(const char *fmt, ...) 10 { 11 va_list ap; 12 va_start(ap, fmt); 13 err_doit(1, LOG_INFO, fmt, ap); 14 va_end(ap); 15 return; 16 } 17 /* Fatal error related to system call 18 * Print message and terminate */ 19 void 20 err_sys(const char *fmt, ...) 21 { 22 va_list ap; 23 va_start(ap, fmt); 24 err_doit(1, LOG_ERR, fmt, ap); 25 va_end(ap); 26 exit(1); 27 } 28 /* Fatal error related to system call 29 * Print message, dump core, and terminate */ 30 void 31 err_dump(const char *fmt, ...) 32 { 33 va_list ap; 34 va_start(ap, fmt); 35 err_doit(1, LOG_ERR, fmt, ap); 36 va_end(ap); 37 abort(); /* dump core and terminate */ 38 exit(1); /* shouldn't get here */ 39 } 40 /* Nonfatal error unrelated to system call 41 * Print message and return */ 42 void 43 err_msg(const char *fmt, ...) 44 { 45 va_list ap; 46 va_start(ap, fmt); 47 err_doit(0, LOG_INFO, fmt, ap); 48 va_end(ap); 49 return; 50 } 51 /* Fatal error unrelated to system call 52 * Print message and terminate */ 53 void 54 err_quit(const char *fmt, ...) 55 { 56 va_list ap; 57 va_start(ap, fmt); 58 err_doit(0, LOG_ERR, fmt, ap); 59 va_end(ap); 60 exit(1); 61 } 62 /* Print message and return to caller 63 * Caller specifies "errnoflag" and "level" */ 64 static void 65 err_doit(int errnoflag, int level, const char *fmt, va_list ap) 66 { 67 int errno_save, n; 68 char buf[MAXLINE + 1]; 69 errno_save = errno; /* value caller might want printed */ 70 #ifdef HAVE_VSNPRINTF 71 vsnprintf(buf, MAXLINE, fmt, ap); * safe */ 72 #else 73 vsprintf(buf, fmt, ap); /* not safe */ 74 #endif 75 n = strlen(buf); 76 if (errnoflag) 77 snprintf(buf + n, MAXLINE - n, ": %s", strerror(errno_save)); 78 strcat(buf, "\n"); 79 if (daemon_proc) { 80 syslog(level, buf); 81 } else { 82 fflush(stdout); /* in case stdout and stderr are the same */ 83 fputs(buf, stderr); 84 fflush(stderr); 85 } 86 return; 87 } </pre> <ul> </ul> </td> </tr> </tbody> </table> <td> </td> <table cellspacing="0" cellpadding="0" width="100%" border="0"> <tbody> <tr> <td class="tt1"> <font color="#002c99"> </font> </td> <td class="tt1" valign="top" align="right"> </td> </tr> </tbody> </table> <img src ="http://www.shnenglu.com/sscchh-2000/aggbug/6838.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/sscchh-2000/" target="_blank">鍙蹭紶綰?/a> 2006-05-09 21:39 <a href="http://www.shnenglu.com/sscchh-2000/archive/2006/05/09/6838.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>unp.h鏂囦歡鍐呭http://www.shnenglu.com/sscchh-2000/archive/2006/05/09/6836.html鍙蹭紶綰?/dc:creator>鍙蹭紶綰?/author>Tue, 09 May 2006 12:43:00 GMThttp://www.shnenglu.com/sscchh-2000/archive/2006/05/09/6836.htmlhttp://www.shnenglu.com/sscchh-2000/comments/6836.htmlhttp://www.shnenglu.com/sscchh-2000/archive/2006/05/09/6836.html#Feedback3http://www.shnenglu.com/sscchh-2000/comments/commentRss/6836.htmlhttp://www.shnenglu.com/sscchh-2000/services/trackbacks/6836.html 1 /* Our own header. Tabs are set for 4 spaces, not 8 */ 2 #ifndef __unp_h 3 #define __unp_h 4 #include "../config.h" /* configuration options for current OS */ 5 /* "../config.h" is generated by configure */ 6 /* If anything changes in the following list of #includes, must change 7 acsite.m4 also, for configure's tests. */ 8 #include <sys/types.h> /* basic system data types */ 9 #include <sys/socket.h> /* basic socket definitions */ 10 #include <sys/time.h> /* timeval{} for select() */ 11 #include <time.h> /* timespec{} for pselect() */ 12 #include <netinet/in.h> /* sockaddr_in{} and other Internet defns */ 13 #include <arpa/inet.h> /* inet(3) functions */ 14 #include <errno.h> 15 #include <fcntl.h> /* for nonblocking */ 16 #include <netdb.h> 17 #include <signal.h> 18 #include <stdio.h> 19 #include <stdlib.h> 20 #include <string.h> 21 #include <sys/stat.h> /* for S_xxx file mode constants */ 22 #include <sys/uio.h> /* for iovec{} and readv/writev */ 23 #include <unistd.h> 24 #include <sys/wait.h> 25 #include <sys/un.h> /* for Unix domain sockets */ 26 #ifdef HAVE_SYS_SELECT_H 27 # include <sys/select.h> /* for convenience */ 28 #endif 29 #ifdef HAVE_SYS_SYSCTL_H 30 # include <sys/sysctl.h> 31 #endif 32 #ifdef HAVE_POLL_H 33 # include <poll.h> /* for convenience */ 34 #endif 35 #ifdef HAVE_SYS_EVENT_H 36 # include <sys/event.h> /* for kqueue */ 37 #endif 38 #ifdef HAVE_STRINGS_H 39 # include <strings.h> /* for convenience */ 40 #endif 41 /* Three headers are normally needed for socket/file ioctl's: 42 * <sys/ioctl.h>, <sys/filio.h>, and <sys/sockio.h>. 43 */ 44 #ifdef HAVE_SYS_IOCTL_H 45 # include <sys/ioctl.h> 46 #endif 47 #ifdef HAVE_SYS_FILIO_H 48 # include <sys/filio.h> 49 #endif 50 #ifdef HAVE_SYS_SOCKIO_H 51 # include <sys/sockio.h> 52 #endif 53 #ifdef HAVE_PTHREAD_H 54 # include <pthread.h> 55 #endif 56 #ifdef HAVE_NET_IF_DL_H 57 # include <net/if_dl.h> 58 #endif 59 #ifdef HAVE_NETINET_SCTP_H 60 #include <netinet/sctp.h> 61 #endif 62 /* OSF/1 actually disables recv() and send() in <sys/socket.h> */ 63 #ifdef __osf__ 64 #undef recv 65 #undef send 66 #define recv(a,b,c,d) recvfrom(a,b,c,d,0,0) 67 #define send(a,b,c,d) sendto(a,b,c,d,0,0) 68 #endif 69 #ifndef INADDR_NONE 70 #define INADDR_NONE 0xffffffff /* should have been in <netinet/in.h> */ 71 #endif 72 #ifndef SHUT_RD /* these three POSIX names are new */ 73 #define SHUT_RD 0 /* shutdown for reading */ 74 #define SHUT_WR 1 /* shutdown for writing */ 75 #define SHUT_RDWR 2 /* shutdown for reading and writing */ 76 #endif 77 #ifndef INET_ADDRSTRLEN 78 #define INET_ADDRSTRLEN 16 /* "ddd.ddd.ddd.ddd\0" 79 1234567890123456 */ 80 #endif 81 /* Define following even if IPv6 not supported, so we can always allocate 82 an adequately sized buffer without #ifdefs in the code. */ 83 #ifndef INET6_ADDRSTRLEN 84 #define INET6_ADDRSTRLEN 46 /* max size of IPv6 address string: 85 "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx" or 86 "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:ddd.ddd.ddd.ddd\0" 87 1234567890123456789012345678901234567890123456 */ 88 #endif 89 /* Define bzero() as a macro if it's not in standard C library. */ 90 #ifndef HAVE_BZERO 91 #define bzero(ptr,n) memset (ptr, 0, n) 92 #endif 93 /* Older resolvers do not have gethostbyname2() */ 94 #ifndef HAVE_GETHOSTBYNAME2 95 #define gethostbyname2(host,family) gethostbyname((host)) 96 #endif 97 /* The structure returned by recvfrom_flags() */ 98 struct unp_in_pktinfo { 99 struct in_addr ipi_addr; /* dst IPv4 address */ 100 int ipi_ifindex; /* received interface index */ 101 }; 102 /* We need the newer CMSG_LEN() and CMSG_SPACE() macros, but few 103 implementations support them today. These two macros really need 104 an ALIGN() macro, but each implementation does this differently. */ 105 #ifndef CMSG_LEN 106 #define CMSG_LEN(size) (sizeof(struct cmsghdr) + (size)) 107 #endif 108 #ifndef CMSG_SPACE 109 #define CMSG_SPACE(size) (sizeof(struct cmsghdr) + (size)) 110 #endif 111 /* POSIX requires the SUN_LEN() macro, but not all implementations define 112 it (yet). Note that this 4.4BSD macro works regardless whether there is 113 a length field or not. */ 114 #ifndef SUN_LEN 115 # define SUN_LEN (su) \ 116 (sizeof (*(su)) - sizeof ((su)->sun_path) + strlen((su)->sun_path)) 117 #endif 118 /* POSIX renames "Unix domain" as "local IPC." 119 Not all systems define AF_LOCAL and PF_LOCAL (yet). */ 120 #ifndef AF_LOCAL 121 #define AF_LOCAL AF_UNIX 122 #endif 123 #ifndef PF_LOCAL 124 #define PF_LOCAL PF_UNIX 125 #endif 126 /* POSIX requires that an #include of <poll.h> define INFTIM, but many 127 systems still define it in <sys/stropts.h>. We don't want to include 128 all the STREAMS stuff if it's not needed, so we just define INFTIM here. 129 This is the standard value, but there's no guarantee it is -1. */ 130 #ifndef INFTIM 131 #define INFTIM (-1) /* infinite poll timeout */ 132 #ifdef HAVE_POLL_H 133 #define INFTIM_UNPH /* tell unpxti.h we defined it */ 134 #endif 135 #endif 136 /* Following could be derived from SOMAXCONN in <sys/socket.h>, but many 137 kernels still #define it as 5, while actually supporting many more */ 138 #define LISTENQ 1024 /* 2nd argument to listen () */ 139 /* Miscellaneous constants */ 140 #define MAXLINE 4096 /* max text line length */ 141 #define BUFFSIZE 8192 /* buffer size for reads and writes */ 142 /* Define some port number that can be used for our examples */ 143 #define SERV_PORT 9877 /* TCP and UDP */ 144 #define SERV_PORT_STR "9877" /* TCP and UDP */ 145 #define UNIXSTR_PATH "/tmp/unix.str" /* Unix domain stream */ 146 #define UNIXDG_PATH "/tmp/unix.dg" /* Unix domain datagram */ 147 /* Following shortens all the typecasts of pointer arguments: */ 148 #define SA struct sockaddr 149 #define HAVE_STRUCT_SOCKADDR_STORAGE 150 #ifndef HAVE_STRUCT_SOCKADDR_STORAGE 151 /* 152 * RFC 3493: protocol-independent placeholder for socket addresses 153 */ 154 #define __SS_MAXSIZE 128 155 #define __SS_ALIGNSIZE (sizeof(int64_t)) 156 #ifdef HAVE_SOCKADDR_SA_LEN 157 #define __SS_PAD1SIZE (__SS_ALIGNSIZE - sizeof(u_char) - sizeof(sa_family_t)) 158 #else 159 #define __SS_PAD1SIZE (__SS_ALIGNSIZE - sizeof(sa_family_t)) 160 #endif 161 #define __SS_PAD2SIZE (__SS_MAXSIZE - 2*__SS_ALIGNSIZE) 162 struct sockaddr_storage { 163 #ifdef HAVE_SOCKADDR_SA_LEN 164 u_char ss_len; 165 #endif 166 sa_family_t ss_family; 167 char __ss_pad1[__SS_PAD1SIZE]; 168 int64_t __ss_align; 169 char __ss_pad2[__SS_PAD2SIZE]; 170 }; 171 #endif 172 #define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) 173 /* default file access permissions for new files */ 174 #define DIR_MODE (FILE_MODE | S_IXUSR | S_IXGRP | S_IXOTH) 175 /* default permissions for new directories */ 176 typedef void Sigfunc (int); /* for signal handlers */ 177 #define min(a,b) ((a) < (b) ? (a) : (b)) 178 #define max(a,b) ((a) > (b) ? (a) : (b)) 179 #ifndef HAVE_ADDRINFO_STRUCT 180 # include "../lib/addrinfo.h" 181 #endif 182 #ifndef HAVE_IF_NAMEINDEX_STRUCT 183 struct if_nameindex { 184 unsigned int if_index; /* 1, 2, ... */ 185 char *if_name; /* null-terminated name: "le0", ... */ 186 }; 187 #endif 188 #ifndef HAVE_TIMESPEC_STRUCT 189 struct timespec { 190 time_t tv_sec; /* seconds */ 191 long tv_nsec; /* and nanoseconds */ 192 }; 193 #endif

]]>
Unix緗戠粶緙栫▼絎笁鐗?鍗蜂竴:濂楁帴瀛楄仈緗慉PI瀛︿範絎旇(1)http://www.shnenglu.com/sscchh-2000/archive/2006/05/09/6834.html鍙蹭紶綰?/dc:creator>鍙蹭紶綰?/author>Tue, 09 May 2006 12:31:00 GMThttp://www.shnenglu.com/sscchh-2000/archive/2006/05/09/6834.htmlhttp://www.shnenglu.com/sscchh-2000/comments/6834.htmlhttp://www.shnenglu.com/sscchh-2000/archive/2006/05/09/6834.html#Feedback4http://www.shnenglu.com/sscchh-2000/comments/commentRss/6834.htmlhttp://www.shnenglu.com/sscchh-2000/services/trackbacks/6834.htmlhttp://www.unpbook.com/
摟1.1 浠嬬粛

鍥?.1 聽緗戠粶紼嬪簭:聽瀹㈡埛绔拰鏈嶅姟鍣?/h5>

graphics/01fig01.gif

鍥韭?.2 鏈嶅姟鍣ㄥ悓鏃跺鐞嗗涓鎴風(fēng)

graphics/01fig02.gif

鍥韭?.3 鍦ㄥ悓涓涓互澶綉浣跨敤TCP鍗忚閫氫俊鐨勫鎴風(fēng)鍜屾湇鍔″櫒graphics/01fig03.gif
鍥韭?.4 騫垮煙緗戜笂鐨勫鎴風(fēng)涓庢湇鍔″櫒錛堜緥濡俉eb嫻忚鍣ㄥ拰W(xué)eb鏈嶅姟鍣級

graphics/01fig04.gif

摟1.2 浠g爜紺轟緥鍜岃В璇?/p>

1 #include聽 "unp.h"

2 int
3 main(int argc, char **argv)
4 {
5聽聽聽聽 int聽聽聽聽 sockfd, n;
6聽聽聽聽 char聽聽聽 recvline[MAXLINE + 1];
7聽聽聽聽 struct sockaddr_in servaddr;

8聽聽聽聽 if (argc != 2)
9聽聽聽聽聽聽聽聽 err_quit("usage: a.out <IPaddress>");

10聽聽聽聽 if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
11聽聽聽聽聽聽聽聽 err_sys("socket error");

12聽聽聽聽 bzero(&servaddr, sizeof(servaddr));
13聽聽聽聽 servaddr.sin_family = AF_INET;
14聽聽聽聽 servaddr.sin_port = htons(13);聽 /* daytime server */
15聽聽聽聽 if (inet_pton(AF_INET, argv[1], &servaddr.sin_addr) <= 0)
16聽聽聽聽聽聽聽聽 err_quit("inet_pton error for %s", argv[1]);

17聽聽聽聽 if (connect(sockfd, (SA *) &servaddr, sizeof(servaddr)) < 0)
18聽聽聽聽聽聽聽聽 err_sys("connect error");

19聽聽聽聽 while ( (n = read(sockfd, recvline, MAXLINE)) > 0) {
20聽聽聽聽聽聽聽聽 recvline[n] = 0;聽聽聽聽聽聽聽 /* null terminate */
21聽聽聽聽聽聽聽聽 if (fputs(recvline, stdout) == EOF)
22聽聽聽聽聽聽聽聽聽聽聽聽 err_sys("fputs error");
23聽聽聽聽 }
24聽聽聽聽 if (n < 0)
25聽聽聽聽聽聽聽聽 err_sys("read error");

26聽聽聽聽 exit(0);
27 }
鍏朵腑unp.h鏄嚜瀹氫箟鐨勫ご鏂囦歡錛?a class="" title="unp.h鏂囦歡鍐呭" href="/sscchh-2000/archive/2006/05/09/6836.html" target="_blank">鏌ョ湅婧愪唬鐮?/a>銆傛垜浠紪璇戝茍鎵ц浠ヤ笂浠g爜錛屽緱鍒頒互涓嬭緭鍑虹粨鏋滐細

solaris %a.out 206.168.112.96聽聽聽聽 our input

Mon May 26 20:58:40 2003聽聽聽聽聽聽聽聽聽聽the program's output

涓嬮潰綆瑕佸垎鏋愪互涓?7琛屼唬鐮?鍚庣畫绔犺妭涓湁鏇磋緇嗙殑璁ㄨ.

鍖呭惈鎴戜滑鑷繁鐨勫ご鏂囦歡

1 璇ュご鏂囦歡鍖呭惈浜嗗ぇ澶氭暟緗戠粶紼嬪簭鎵闇瑕佺殑澶氫釜澶存枃浠朵互鍙婂畾涔変簡鎴戜滑灝嗚浣跨敤鐨勪竴浜涘父閲?渚嬪 MAXLINE).

鍛戒護琛屽弬鏁?/font>

2鈥? 榪欐槸鍚湁鍛戒護琛屽弬鏁扮殑涓誨嚱鏁板畾涔?鍗砿ain鍑芥暟).鎴戜滑浠NSI C鏍囧噯鏉ヤ功鍐欎唬鐮?

鍒涘緩TCP濂楁帴瀛?a name="ch01lev3sec3">

10鈥?1 socket鍑芥暟璋冪敤鍒涘緩浜嗕竴涓綉緇滄祦濂楁帴瀛?(Internet (AF_INET) stream (SOCK_STREAM) socket), 璇ュ嚱鏁拌繑鍥炰竴涓暣鏁板?瀹冩弿榪頒簡璇ュ鎺ュ瓧,浠ュ悗鐨勫嚱鏁伴氳繃璇ユ暣鏁板兼潵浣跨敤榪欎釜濂楁帴瀛?渚嬪connect鍜宺ead絳夎皟鐢?. 鍏朵腑err_寮澶寸殑鍑芥暟鏄垜浠嚜瀹氫箟鐨勫嚱鏁?璇﹁榪欓噷.

紜畾鏈嶅姟鍣↖P鍦板潃鍜岀鍙e彿

12鈥?6 鎴戜滑濉厖浜嗙綉緇滃鎺ュ瓧鍦板潃緇撴瀯(涓涓悕涓簊ervaddr鐨勭粨鏋勪綋sockaddr_in),濉厖鐨勪俊鎭寘鎷湇鍔″櫒IP鍦板潃鍜岀鍙e彿.鎴戜滑鎶婃暣涓粨鏋勪綋棣栧厛娓呴浂,鐒跺悗璁劇疆鍦板潃鏃忎負AF_INET(IPV6璇ラ」涓篈F_INET6),绔彛鍙蜂負13(鏃墮棿鏈嶅姟鍣ㄧ殑绔彛鍙?鏄竴涓ぇ瀹墮兘鐭ラ亾鐨勭鍙e彿).IP鍦板潃鐢卞懡浠よ鍙傛暟鎸囧畾(argv[1]).IP鍦板潃鍜岀鍙e彿蹇呴』鎸夌収鎸囧畾鐨勬牸寮忔潵濉厖,鎴戜滑閫氳繃璋冪敤htons(涓繪満瀛楄妭嫻佸埌緗戠粶瀛楄妭嫻佺殑杞崲)鍜宨net_pton(鐐瑰垎鍗佽繘鍒跺埌32浣嶆暣鏁扮殑杞崲)涓や釜璋冪敤鏉ヨ繘琛岃漿鍖栧埌鎵闇瑕佺殑鏍煎紡.

鍦ㄨ皟鐢╥net_pton鐨勬椂鍊欏彲鑰岃兘浼氶亣鍒伴棶棰?鍥犱負榪欐槸IPv6鏂板鐨勫嚱鏁?浠ュ墠鐨処Pv4鐗堟湰鍙互璋冪敤inet_addr鏉ユ浛浠h鍑芥暟.

涓庢湇鍔″櫒寤虹珛涓涓繛鎺?/h4>

17鈥?8 TCP濂楁帴瀛楄皟鐢╟onnect鍑芥暟,灝變笌鏈嶅姟鍣?main鍑芥暟鐨勭浜屼釜鍙傛暟)寤虹珛浜嗕竴涓猅CP榪炴帴,鎴戜滑蹇呴』鎸囧畾濂楁帴瀛楃粨鏋勪綋鐨勭涓変釜鍙傛暟闀垮害,瀹冩繪槸璁╃紪璇戝櫒閫氳繃C鐨剆izeof榪愮畻絎︽潵璁$畻.

璇誨彇鍜屾樉紺烘湇鍔″櫒鐨勫洖澶?/h4>

19鈥?5 璋冪敤read鏉ヨ鍙栨湇鍔″櫒鐨勫洖澶?鍒╃敤鏍囧噯I/O鏉ユ樉紺鴻鍥炲淇℃伅.姝ゅ,鍦ㄤ嬌鐢═CP鐨勬椂鍊欐垜浠繀欏昏娉ㄦ剰,鍥犱負瀹冩槸涓涓病鏈夎竟鐣岀殑瀛楄妭嫻佸崗璁?鏈嶅姟鍣ㄧ殑鍥炲鏄竴涓?6瀛楄妭鐨勪覆:

Mon May 26 20 : 58 : 40 2003\r\n

\r 鏄洖杞? \n 鏄崲琛?

緇堟紼嬪簭
26 exit 緇堟紼嬪簭.Unix鍦ㄤ竴涓繘紼嬬粨鏉熸椂鍊欐繪槸鍏抽棴鎵鏈夋墦寮鐨勬弿榪扮,鍥犳鎴戜滑鐨凾CP濂楁帴瀛楁鏃跺叧闂簡.
鍚庣畫鍐呭灝嗗姝ゆ湁鏇存繁鍏ョ殑璁ㄨ.



]]>
VC涓鍥?View)閫氱煡瀵硅瘽妗?Dialog)鐨勬柟娉?/title><link>http://www.shnenglu.com/sscchh-2000/archive/2006/04/28/6438.html</link><dc:creator>鍙蹭紶綰?/dc:creator><author>鍙蹭紶綰?/author><pubDate>Fri, 28 Apr 2006 13:47:00 GMT</pubDate><guid>http://www.shnenglu.com/sscchh-2000/archive/2006/04/28/6438.html</guid><wfw:comment>http://www.shnenglu.com/sscchh-2000/comments/6438.html</wfw:comment><comments>http://www.shnenglu.com/sscchh-2000/archive/2006/04/28/6438.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/sscchh-2000/comments/commentRss/6438.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/sscchh-2000/services/trackbacks/6438.html</trackback:ping><description><![CDATA[     鎽樿: 鍦ㄥ埄鐢? VC 錛? MFC 緙栫▼鐨勬椂鍊欙紝鎴戜滑寰寰鑳界鍒拌繖縐嶆儏鍐碉細鍦ㄤ竴涓ā鎷熺▼搴忎腑錛堝鏈変簺娓告垙錛夛紝闇瑕佸疄鏃舵樉紺轟竴浜涘睘鎬х殑鍊鹼紙鏂囧瓧鎴栬呭浘褰級錛岃繖涓椂鍊欐垜浠彲浠ラ噸鏂版墦寮涓涓璇濇錛堝彲浠ユ槸涓涓ā鎬佹垨鑰呴潪妯℃佺殑錛夋潵鏄劇ず榪欎簺淇℃伅錛屾湰鏂囦互妯℃佸璇濇涓轟緥錛岀畝鍗曞疄鐜拌繖涓妧鏈備互涓嬩唬鐮侀槾褰遍儴鍒嗘槸鎴戝埄鐢? ClassWizard 鍔犵殑錛岃摑鑹查儴鍒嗘槸鎴戞墜宸ュ姞鐨勩傚叾浣欐槸...  <a href='http://www.shnenglu.com/sscchh-2000/archive/2006/04/28/6438.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/sscchh-2000/aggbug/6438.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/sscchh-2000/" target="_blank">鍙蹭紶綰?/a> 2006-04-28 21:47 <a href="http://www.shnenglu.com/sscchh-2000/archive/2006/04/28/6438.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>涓涓鍙栨暟鎹簱鐨勯棶棰?/title><link>http://www.shnenglu.com/sscchh-2000/archive/2006/04/25/6272.html</link><dc:creator>鍙蹭紶綰?/dc:creator><author>鍙蹭紶綰?/author><pubDate>Tue, 25 Apr 2006 13:11:00 GMT</pubDate><guid>http://www.shnenglu.com/sscchh-2000/archive/2006/04/25/6272.html</guid><wfw:comment>http://www.shnenglu.com/sscchh-2000/comments/6272.html</wfw:comment><comments>http://www.shnenglu.com/sscchh-2000/archive/2006/04/25/6272.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/sscchh-2000/comments/commentRss/6272.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/sscchh-2000/services/trackbacks/6272.html</trackback:ping><description><![CDATA[ <p>鏈榪戠敱浜庤鍙戝竷浜ら氫豢鐪熺▼搴?TSS)鐨凞emo鐗堬紝浠ュ墠紼嬪簭浣跨敤鐨勬槸鍩轟簬SQL2000鏁版嵁搴撶殑鏁版嵁婧愶紝鐜板湪闇瑕佹敼鎴愬熀浜嶢ccess鏁版嵁搴擄紝浣嗘槸鍦ㄦ敼鎴怉ccess鏁版嵁搴撲箣鍚庯紝鍙戠幇浠跨湡鐨勬椂鍊欙紝鍓嶅彴瀹㈡埛绔▼搴忓彲浠ユ甯歌鍙朅ccess鏁版嵁搴擄紝鑰屽悗鍙版湇鍔″櫒榪涚▼涓嶈兘澶熸紜殑璇誨彇鏁版嵁搴撱備負浠涔堜嬌鐢⊿QL2000鏁版嵁搴撶殑鏃跺欐病鏈夐棶棰橈紝鑰屼嬌鐢ˋccess鏁版嵁搴撳氨浼氬嚭鐜伴棶棰樺憿錛熺粡榪囪皟璇曠粓浜庢壘鍑轟簡闂錛氬綋妯℃嫙寮濮嬬殑鏃跺欙紝鍓嶅彴姝ゆ椂姝e湪淇濆瓨璇ユ柟妗堝彿鐨勪俊鎭埌鏁版嵁搴撲腑錛岃屾鏃跺悗鍙版湇鍔″櫒紼嬪簭涔熺揣鎺ョ潃璇誨彇璇ユ柟妗堝彿淇℃伅錛屾鏃舵垜瑙夊緱鍙兘鏄疉ccess鏁版嵁搴撳湪澶勭悊騫跺彂鐨勬椂鍊欏嚭鐜頒簡闂銆備互鑷翠簬鏈嶅姟鍣ㄨ繘紼嬭鍙栫殑鏂規(guī)鍙蜂俊鎭笉姝g‘錛屾帴涓嬫潵鐨勫叾瀹冧俊鎭篃灝變笉姝g‘浜嗭紝榪欏氨閫犳垚浜嗕笉鑳芥甯告ā鎷熴傘擲QL鏁版嵁搴撳湪澶勭悊榪欑鎯呭喌鏃訛紝鍙兘鏄湁涓涓緢濂界殑鏈哄埗淇濊瘉浜嗘暟鎹殑姝g‘鎬с傘?/p> <img src ="http://www.shnenglu.com/sscchh-2000/aggbug/6272.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/sscchh-2000/" target="_blank">鍙蹭紶綰?/a> 2006-04-25 21:11 <a href="http://www.shnenglu.com/sscchh-2000/archive/2006/04/25/6272.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>VC涓闂瓵ccess鏁版嵁搴撶殑鏂規(guī)硶錛堜笉闇瑕佺敤鎴峰緩绔婳DBC鏁版嵁婧愶級http://www.shnenglu.com/sscchh-2000/archive/2006/04/13/ab.html鍙蹭紶綰?/dc:creator>鍙蹭紶綰?/author>Thu, 13 Apr 2006 05:01:00 GMThttp://www.shnenglu.com/sscchh-2000/archive/2006/04/13/ab.htmlhttp://www.shnenglu.com/sscchh-2000/comments/5457.htmlhttp://www.shnenglu.com/sscchh-2000/archive/2006/04/13/ab.html#Feedback9http://www.shnenglu.com/sscchh-2000/comments/commentRss/5457.htmlhttp://www.shnenglu.com/sscchh-2000/services/trackbacks/5457.html  闃呰鍏ㄦ枃

]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲欧洲午夜| 亚洲国产精品激情在线观看| 亚洲二区在线视频| 亚洲第一天堂av| 欧美啪啪成人vr| 午夜伦欧美伦电影理论片| 中文在线资源观看网站视频免费不卡| 欧美日韩精品一区二区在线播放| 亚洲午夜av电影| 欧美在线日韩精品| 91久久久国产精品| 中文国产亚洲喷潮| 黄色国产精品一区二区三区| 亚洲国产精品久久久久| 欧美网站在线| 久久亚洲一区| 欧美另类人妖| 久久久福利视频| 欧美精品18videos性欧美| 午夜激情亚洲| 欧美成人亚洲成人| 午夜在线观看免费一区| 久久久久久久波多野高潮日日| 日韩网站在线观看| 欧美影片第一页| 夜夜嗨av一区二区三区四区| 欧美一区二区成人6969| 99av国产精品欲麻豆| 欧美一区二区三区日韩视频| 99精品视频网| 久久精品首页| 亚洲欧美日韩系列| 欧美精品在线免费| 久久尤物视频| 欧美亚洲专区| 国产精品乱码一区二三区小蝌蚪| 亚洲淫片在线视频| 欧美成人精精品一区二区频| 欧美在线啊v| 欧美色欧美亚洲高清在线视频| 老司机一区二区三区| 国产精品一区二区久久久久| 最新国产精品拍自在线播放| 国产一区白浆| 亚洲欧洲av一区二区三区久久| 一区二区不卡在线视频 午夜欧美不卡在 | 亚洲高清视频一区二区| 亚洲免费在线视频| 亚洲桃色在线一区| 欧美激情综合五月色丁香小说| 免费成人高清在线视频| 国模吧视频一区| 欧美一级黄色网| 欧美中文字幕在线视频| 国产精品久久中文| 中国av一区| 亚洲欧美99| 国产精品免费网站在线观看| 一区二区三区久久| 亚洲一区免费视频| 欧美午夜国产| 亚洲午夜一区| 香港久久久电影| 国产精品视频xxx| 亚洲免费视频一区二区| 午夜视频久久久久久| 国产精品久久网站| 亚洲免费在线| 久久另类ts人妖一区二区| 国产亚洲欧美一区二区三区| 欧美一区二区三区在线| 快射av在线播放一区| 1024成人| 欧美美女日韩| 亚洲视频播放| 久久国产福利国产秒拍| 狠狠干综合网| 男人的天堂成人在线| 亚洲国产一区二区精品专区| 一区二区不卡在线视频 午夜欧美不卡在 | 小辣椒精品导航| 久久婷婷国产综合国色天香| 1000部精品久久久久久久久| 欧美二区乱c少妇| 亚洲精品免费观看| 午夜宅男久久久| 激情综合视频| 欧美日韩精品不卡| 亚洲一区二区3| 欧美不卡高清| 亚洲视频精选| 蜜臀久久99精品久久久久久9| 亚洲精品在线电影| 国产精品三区www17con| 六十路精品视频| 夜色激情一区二区| 噜噜噜91成人网| 亚洲视频1区| 在线精品亚洲| 国产精品国产三级国产专播品爱网| 新狼窝色av性久久久久久| 欧美成人在线免费视频| 性欧美大战久久久久久久久| 亚洲福利在线观看| 国产精品美女久久久浪潮软件| 久久影院午夜论| 亚洲视频www| 亚洲欧洲日本专区| 久久久人成影片一区二区三区| 亚洲美女视频网| 尤物视频一区二区| 国产精品久久毛片a| 欧美高清成人| 久久成人18免费观看| 一区二区三区四区五区精品视频 | 先锋影音久久久| 日韩小视频在线观看专区| 韩国一区二区三区在线观看| 国产精品红桃| 欧美片网站免费| 久久躁日日躁aaaaxxxx| 欧美一区二区三区精品| 一本色道久久综合亚洲精品小说 | 亚洲综合另类| 99热这里只有成人精品国产| 欧美高清在线视频观看不卡| 久久男人资源视频| 久久国产精彩视频| 欧美一级在线视频| 亚洲女爱视频在线| 中文一区在线| 亚洲午夜视频| 亚洲午夜免费视频| 亚洲一区二区三区在线视频| 正在播放亚洲| 一区二区三区精品视频| 日韩视频免费| 一本久久综合亚洲鲁鲁| 亚洲欧洲精品天堂一级| 亚洲人体1000| 99国产一区二区三精品乱码| 亚洲美女啪啪| 一本色道久久综合亚洲精品婷婷 | 亚洲日本中文| 一本高清dvd不卡在线观看| 91久久久久| 一本色道久久加勒比精品| 9色精品在线| 亚洲一区二区欧美日韩| 亚洲欧美日韩国产精品| 欧美一区二区三区在线看| 欧美在线观看网站| 美女任你摸久久| 欧美激情一区二区三区高清视频| 欧美黄色大片网站| 亚洲精选一区二区| 亚洲视频在线观看一区| 欧美一区二区在线视频| 亚洲茄子视频| 好吊日精品视频| 合欧美一区二区三区| 亚洲精品在线视频| 亚洲宅男天堂在线观看无病毒| 欧美一级网站| 欧美成人一区二区三区在线观看| 亚洲国产乱码最新视频| 一本久久a久久免费精品不卡| 午夜欧美大尺度福利影院在线看| 久久精品网址| 欧美性jizz18性欧美| 国内精品视频666| 99re成人精品视频| 久久精品道一区二区三区| 欧美国产三级| 午夜精品视频在线观看一区二区 | 亚洲一区二区三区色| 久久都是精品| 欧美日韩一区综合| 好吊色欧美一区二区三区四区| 99re热这里只有精品免费视频| 欧美一区二区福利在线| 亚洲国产精品一区二区尤物区 | 女人香蕉久久**毛片精品| 一本久道久久久| 免费观看亚洲视频大全| 国产精品推荐精品| 亚洲美女av网站| 久久躁狠狠躁夜夜爽| 国产精品99久久久久久久久| 久久亚洲私人国产精品va| 国产精品高潮久久| 亚洲精品一区二区网址| 久久久水蜜桃av免费网站| 99国产精品久久久久久久| 久久综合亚洲社区| 国产一区二区久久精品| 亚洲综合色视频| 日韩亚洲欧美中文三级| 欧美成人在线免费观看| 伊人色综合久久天天五月婷|