作者XX9 ( 佛曰: ....)
看板FCUProblems
标题[考古] 网路程式设计/刘振绪/94下期末考
时间Fri Jan 16 20:42:01 2009
※ [本文转录自 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
1F:推 windward:话说前几天整理房间才丢掉一堆考古题 早知道就照下来po 07/09 13:35
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.132.214.27