题目内容

阅读以下说明、Java源程序和运行测试部分,将应填入(n)处的解答写在对应栏中。
1. HTTP 协议
HTTP请 求消息示例
GET/index, htmIHTTP/1.1
Accept: image/gif, image/jpeg, */*
Accept-Language: zh-ch
Accept-encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE6.0; Windows NT5.1)
Host: IocaIhost: 8080
Connection: Keep-Alive
HTTP/1.1 200 OK
Servert: Microsoft-IIS/4.0
Date: Mon, 3 Jan 1998 13:13:33 GMT
Content-Type: text/html
Last-Modified: Mon, 11 Jan 1998 13:23:42 GMT
Contelit-Length: 112
< html >

2.相关类及主要成员函数
ServerSocket类:
服务器端套接字,它监听固定端口,以接收来自客户端的连接请求,一旦建立连接就返回一个Socket类型的对象。类中的主要成员函数见表1。
基于连接的套接字。类中的主要成员函数见表2。
[Java源程序;一个简单的web服务器]
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*WebScrvc. java */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
packageobjclass;
importjaVa. net. *;
importjaVa. io. *;
public class WebServer{
//web服务器侦听的端口号
public static final int PORT=8080;
//WEB-ROOT变量存放web服务器工作目录,该目录存放HTML、GIF图片等静态文件资源
public static final String WEB-ROOT=
Systern. getProperty("user.dir")+File. separator+"webmot";
//SHUTDOWN_COMMAND变量保存关闭服务器的命令
private static final string SHUTDOWN_COMMAND="/shutdown";
//是否收到关闭服务器命令的标志
private boolean Shutdown=false;
public static void main(Sting[]args){
WebServerserver; newWebserver();
Server.await();
}
public void await(){
ServerSocke serverSocke=null;
try{
//创建侦听端口号为PORT的ServerSocket类型的对象
ServerSocket=new(1);
System. out. println("WebServerStarted!");
!
catch(IOException e){
e.printStackTrace();
System.exit (1);
}
//循环等待客户端连接
While(!Shutdown){
Socket socket=null;
InputStream input=null;
OutputStream output=null;
try{
//创建来自客户端的连接套接宇
Socket=(2);
//创建输入流
input=socket. (3);
//创建输出流
Output=socket. (4);
//创建request对象
Request request=new Request(input);
//解析客户端HTTP请求
request, parse();
//创建Response 对象
Response response=new (5);
//将 request 对象传递给 response 对象
response. setRequest(request);
//给客户端发送所请求的静态资源
response. (6);
//关闭连接套接字
(7);
//判断当前HTTP 请求中的URI是否是关闭服务器命令
shutdown-request. getUri(). equals(SHUTDOWN_COMMAND);
Catch (Exception e) {
e. (8);
continue;
}
}
}
}
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/ * Request. java * /
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
package objclass;
import java.io.InputStream;
import java.io.IOEexception;
public Class Request{
private InputStream input;
private String uri;

查看答案
更多问题

Part A
Letter-Writing (100 words)
Letter of Invitation

阅读下面段落,按要求回答问题。
这一天本在意料之中,可是我怎能相信这是事实呢!他躺在那里,但他已经不是他了,已经不是我那正当盛年的弟弟,他再也不会回答我们的呼唤,再不会劝阻我们的哭泣。你到哪里去了,小弟!自一九七四年沅君姑母逝世起,我家屡遭丧事,而这一次小弟的远去最是违反常规,令人难以接受!我还不得不把这消息告诉当时也在住院的老父,因为我无法回答他每天的第一句问话:“今天小弟怎么样?”我必须告诉他,这是我的责任。再没有弟弟可以依靠了,再不能指望他来分担我的责任了。父亲为他写了挽联:“是好党员,是好干部,壮志未酬,洒泪岂只为家痛;能娴科技,能娴艺文,全才罕遇,招魂也难再归来!”我那唯一的弟弟,永远地离去了。
作者在这一段文字中,是通过什么方式来抒情的?
作者为什么要说“这一次小弟的远去最是违反常规,令人难以接受”?
父亲为小弟写挽联,这是什么描写?有什么表达作用?
请帮忙给出每个问题的正确答案和分析,谢谢!

When you are in the business of sending spacecraft to other planets, it is probably wise to do everything you can m keep your space-probes sterile (无菌的). NASA, America's space agency, certainly does so. After all, you would not want hugs from one planet to contaminate another where they might possibly thrive.
But according to Curt Mileikowsky, of the Royal Institute of Technology in Stockholm, this may already have happened naturally billions of years ago when the solar sys- tem was young. For Dr Mileikowsky has taken a century-old idea called panspermia (有生源说), and shown that it is plausible.
57. Panspermia is the theory that life does not start independently on each planet that has it (assuming that other planets do). Rather, it hops from place to place, "infecting" new worlds as it goes. Supported by experts in biology, geology and celestial mechanics, Dr Mileikowsky argued to the American Astronomical Society meeting in Atlanta that this is not as outlandish as it sounds.
58. Bungling (笨手笨脚) space organizations apart, the only mode of travel open to microbes seems to be meteorites (流星). Most of these are small bits of junk from the asteroid (小行星) belt that have gone off course. But some are rocks that have been flung into space from the surfaces of planets as a result of those planets having been struck by even larger bits of rock--decent-sized asteroids or comets.
59. If there is life on such a planet, microscopic forms of it will probably live deep in- side rocks, as they do on earth. The acceleration of lift-off would not kill something that size.
60. If a rock is large enough, the heat generated as it is thrown clear will be negligible except at its surface--where, ii anything, melting may even produce an airtight skin to protect any microbes deeper down from the unpleasant vacuum of space.
(56)

闻道百,以为莫己若者,我之谓也 莫己若:

答案查题题库