?? readme .txt~
字號(hào):
Assuming that the exercise files was in the directory /handout.
1. How to run the Client?
Run the Client classs with the following command:
java Client <hostname>
When the class is running, a promot will apears:
"<hostname> is listening to your request:"
Then we can use the GET command to get files from the server.
The following is an example:
javac Client.java
java Client www.baidu.com
GET /index.htm HTTP/1.0
Then the respond information is output.
we input the file name to save the request file data.
Then we can open the file in the same directory as the .class file, i.e. /handout.
2. How to run the Server ?
Using the following command to run the Server class
javac Server.java
"java Server"
Then a promot will appear:
"The server is now waiting for request..."
Then we open a Web Browser and input the following
http://localhost:8000/index.html
It must be point out that index.html is a file in the /handout directory as the Server.class
Then we can see the web page.
we can also get a .jpg or .gif file via the web browser. As it is the same as getting the .html files.
3. How to run the ThreadedServer?
The use of the ThreadedServer is almost the same as the the Server, except that the ThreadedServer can accept multiple request at the same time.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -