正在加载图片...
(2)Iterative, Connection-Oriented Server Algorithm 1. Create a stream(tCP)socket and bind to the well-known address for the service being offered 2. Place the socket in passive mode. making it ready for use by a server 3. Accept the next connection request from the socket and obtain a new socket for the connection 4. Repeatedly receive a request from the client, formulate a response, and send a reply back to the client according to the application protocol 5. When finished with a particular client, close the connection and return to step 3 to accept a new connection a less common server type used for services that require a trivial amount of processing for each request, but for which reliable transport is necessary Exampl http://www.comp.hkbu.edu.hk/-comp2330/example/daytimetcpsrv.c 1313 (2) Iterative, Connection-Oriented Server Algorithm 1. Create a stream (TCP) socket and bind to the well-known address for the service being offered. 2. Place the socket in passive mode, making it ready for use by a server. 3. Accept the next connection request from the socket, and obtain a new socket for the connection. 4. Repeatedly receive a request from the client, formulate a response, and send a reply back to the client according to the application protocol. 5. When finished with a particular client, close the connection and return to step 3 to accept a new connection. A less common server type used for services that require a trivial amount of processing for each request, but for which reliable transport is necessary. Example: http://www.comp.hkbu.edu.hk/~comp2330/example/daytimetcpsrv.c
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有