⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 S S D 1 练习的代码
💻 TXT
字号:
Readme for Exercise 1 of SSD 8 

---------------------- 

Client.java 

First, compile this java file through cmd: 
javac Client.java 
to Client.class. 

Second, run this class file also through cmd: 
java Client <the address of web server>
Then you can see the guide for input the request if the connection is OK. Now, input the request. 
For example: GET / HTTP/1.0

Then the web information will be displayed on the screen and the program will remind you to save the web file. 
At last, input the file name which you wanna save. 
For example: ex1.html
  
Note: If you don't input the address of web server, the program will input an error message on the screen. 

----------------------
  
Server.java 

First, compile this java file through cmd: 
javac Server.java 
to Server.class. 

Second, run this class file also through cmd: 
java Server
Now the server is waiting for request from clients. When a client connecting with it, it will display some conditions about the connection on the screen. 
  
Note: This server could only respond the GET method request. And the connection will be closed if a request is not having a right format. For example, wrong method, wrong filename format or non-existed filename, etc. 
  
----------------------

ThreadedServer.java
 
First, compile this java file through cmd: 
javac ThreadedServer.java 
to ThreadedServer.class. 

Second, run this class file also through cmd: 
java ThreadedServer
Now the server is waiting for request from clients. 
When clients connecting with it, it will display the number of clients and the other conditions about the connection on the screen. 
  
Note: This server could only respond the GET method request. And the connection will be closed if a request is not having a right format. For example, wrong method, wrong filename format or non-existed filename, etc.  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -