看板 FCUProblems 關於我們 聯絡資訊
※ [本文轉錄自 FCU_Talk 看板] 作者: passersby (<( ̄ c ̄)y▂ξ) 看板: FCU_Talk 標題: [考題] [網路程式設計][劉振緒][94下期末考] 時間: Mon Jul 9 12:08:48 2007 [網路程式設計][劉振緒][94下期末考] 1. (20%) Given the following system calls, 1 accept() 2 bind() 3 connect() 4 gethostbyname() 5 getprotobyname() 6 getservbyname() 7 listen() 8 socket() One may construct a skeleton of a UDP server program as a sequence of: 6, 5, 8, 2, 7, which means that one may use the system calls (in sequence): getservbyname(), getprotobyname(), socket(), bind(), listen() to form a UDP server program. Write a sequence of system calls to construct (a) a skeleton of a TCP client program, and (b) a skeleton of a TCP server program. 2. (20%) The super server inetd in UNIX is a typical example for multiservice servers. The following are some lines from files /etc/services and /etc/inetd.conf, respectively: ------- echo 7/udp ftp 21/tcp telnet 23/tcp ------- telnet stream tcp nowait root /usr/libexec/telnetd telnetd ftp stream tcp nowait root /usr/local/libexec/ftpd ftpd -a echo dgram udp nowait root internal ------- (a) What does each field mean in both files? (b) Explain how the inetd handles requests for telnet, ftp, and echo servers. (c) Describe the process structure of the inetd when it handles the above three services, respectively. 3. (20%) Question concerning Remote Procedure Call. (a) The rpcgen is often used to bind a distributed application. Describe the contents of a rpcgen specification i.e., an account.x file. (b) What are the output of rpcgen? Briefly describe the contents of each file. (c) Describe what are stub and interface. 4. (20%) (A flavor of Perl.) The following three code segments are taken from our proxy example. Explain briefly what each code segment does. (a) use IO::Socket::INET; (b) new IO::Socket::INET( LocalHost => 0,   LocalPort => $port,   Proto => 'tcp'   Listen => $max_request,   Resuse => 1,   ) || die "socket: $!"; (c) new IO::Socket::INET (   PeerAdr => $remote_ip,   PeerPort => $port,   Proto => 'tcp'   ) || die "socket: $!"; 5. (20%) At present, Socket, RPC, and distribute OO (e.g., RMI) are three paradigms for network programming. (a) Which one is your favorite and why? (b) Are these three going to survive for the next 10 years why or why not? (c) What about these for next 50 years? 6. (10%) Some feedback from you. Which part of this course you like most? Why? Which part of this course you dislike most? Why? -- 嘖嘖嘖 好多考題都不小心被我丟了 不過都是很古老的 囧 -- http://www.wretch.cc/blog/danielhsieh 抓緊最後能夠放鬆的日子!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.229.93.78
windward:話說前幾天整理房間才丟掉一堆考古題 早知道就照下來po 07/09 13:35
-- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.132.214.27