Socket Programming in Client/Server Model Two types of server Concurrent server-forks a new process,so multiple clients can be handled at the same time Iterative server-the server processes one request before accepting the next Concept HIstory Status Future
Concept HIstory Status Future 6 Two types of server ▪ Concurrent server – forks a new process, so multiple clients can be handled at the same time. ▪ Iterative server – the server processes one request before accepting the next. Socket Programming in Client/Server Model Concept
Socket Programming in Client/Server Model listened socket(.) bind( (listened,…); listen( listened,… for(:: i Concurrent connfd accept(listened, .. Server If (( pid= forko)==0i/child*/ close(listened) process the e request * close(conned) exit(O) close(connfd);/* parent* Concept HIstory Status Future 7
Concept HIstory Status Future 7 Concurrent Server listenfd = socket(…); bind(listenfd,…); listen(listenfd,…) for ( ; ; ) { connfd = accept(listenfd, …); If (( pid = fork()) == 0) { /* child*/ close(listenfd); /* process the request */ close(connfd); exit(0); } close(connfd); /* parent*/ } Socket Programming in Client/Server Model Concept
Socket Programming in Client/Server Model listened socket(.) bind( (listened,…) Iterative iten( listened,… Server for(;; conned = accept(listened process the request close(conned) Concept HIstory Status Future
Concept HIstory Status Future 8 Iterative Server listenfd = socket(…); bind(listenfd,…); listen(listenfd,…) for ( ; ; ) { connfd = accept(listenfd, …); /* process the request */ close(connfd); } Socket Programming in Client/Server Model Concept
Socket Programming in Client/Server Model sockfd= socket( connect(sockfd, .. Client / process the request * close(sockfd) Concept HIstory Status Future 9
Concept HIstory Status Future 9 Client sockfd = socket(…); connect(sockfd, …) /* process the request */ close(sockfd); Socket Programming in Client/Server Model Concept
Content Delivery Networks(CDN): A Transition Model Servers are decentralized(duplicated throughout the Internet The distributed servers are controlled by a centralized authority(headquarters) EXamples: Internet content distributions by Akamai Overcast. and ffnet Both Client/Server and cdn models have single point of failures Concept HIstory Status Future
Concept HIstory Status Future 10 Content Delivery Networks (CDN): A Transition Model Servers are decentralized (duplicated) throughout the Internet. The distributed servers are controlled by a centralized authority (headquarters). Examples: Internet content distributions by Akamai, Overcast, and FFnet. Both Client/Server and CDN models have single point of failures. Concept