This preview shows page 1. Sign up to view the full content.
Unformatted text preview: a connected descriptor that can be used to communicate with the client using Unix I/O functions. The distinction between a listening descriptor and a connected descriptor can be confusing when we ﬁrst encounter the accept function. The listening descriptor serves as an endpoint for client connection requests. It is typically created once and exists for the lifetime of the server. The connected descriptor is the endpoint of the connection that is established between the client and the server. It is created each time the server accepts a connection request and exists only as long as it takes the server to service a client. Figure 12.26 outlines the roles of the listening and connected descriptors. In Step 1, the server calls accept, which waits for a connection request to arrive on the listening descriptor, which for concreteness we will assume is descriptor 3 (recall that descriptors 0–2 are reserved for the standard ﬁles).
listenfd(3) client clientfd connection request client clientfd server 1. Se...
View Full Document
- Spring '10
- The American