Server software design Examples Chuan-Ming LIu Computer Science and Information Engineering Spring 2004, NTUT TAIWAN CSIE NTUT Taiwan
1 CSIE, NTUT, Taiwan Server Software Design Examples Chuan-Ming Liu Computer Science and Information Engineering Spring 2004, NTUT TAIWAN
●● Examples o Iterative, Connectionless Server (UDP) o Iterative. Connected-Oriented server (TCP) o Concurrent Connection-Oriented Server(tCp) SIE NTUT. Taiwan
2 CSIE, NTUT, Taiwan Examples Iterative, Connectionless Server (UDP) Iterative, Connected-Oriented Server (TCP) Concurrent, Connection-Oriented Server (TCP)
Iterative Connectionless Server (UDP)
Iterative, Connectionless Server (UDP)
●。 Creating Passive Socket o To hide the allocation of socket use o passiveudP(passiveUDP C passiverCP(passivercPC two high-level procedures o Both procedures call passivesocko to perform socket allocation passivesock.C 4 SIE NTUT. Taiwan
4 CSIE, NTUT, Taiwan Creating Passive Socket To hide the allocation of socket, use ⚫ passiveUDP (passiveUDP.c) ⚫ passiveTCP (passiveTCP.c) two high-level procedures Both procedures call passivesock() to perform socket allocation – passivesock.c
●●● Port Privilege o To use well-known services(lower port number), the server process needs special privilege o lwo servers on a given computer can not use the same port number at the same time o How to overcome the port privilege? ● Using portbase 5 SIE NTUT. Taiwan
5 CSIE, NTUT, Taiwan Port Privilege To use well-known services (lower port number), the server process needs special privilege Two servers on a given computer can not use the same port number at the same time How to overcome the port privilege? ⚫ Using portbase