• 大小: 937KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-02
  • 语言: Java
  • 标签: java  tcp  http  web  

资源简介

使用Java编写的一个简易多线程HTTP服务器 源代码写于2018年5月份,计算机网络课程的实验作业 代码bug较多,欢迎各位dalao指教

资源截图

代码片段和文件信息

package HttpServer;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class HttpProcessor extends Thread {
private Socket socket;

public HttpProcessor(Socket socket) {
this.socket = socket;
}

@Override
public void run() {
InputStream input = null;
OutputStream output = null;

try {
input = socket.getInputStream();
output = socket.getOutputStream();

HttpRequest request = new HttpRequest(input);// 创建一个对象来处理HTTP请求
new HttpResponse(output request);// 创建一个对象来生成HTTP响应信息并发送给浏览器
input.close();
output.close();
socket.close();

} catch (IOException e) {
e.printStackTrace();
}

}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-11-15 02:44  simple-multithreading-httpserver-master\
     文件        1057  2018-11-15 02:44  simple-multithreading-httpserver-master\LICENSE
     文件         202  2018-11-15 02:44  simple-multithreading-httpserver-master\README.md
     目录           0  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\
     目录           0  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\
     文件        8253  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\example.css
     文件       10201  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\example.js
     目录           0  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\
     文件        1697  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_footer.png
     文件        1697  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_footer_link.png
     文件         748  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_intro.png
     文件       15352  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_actionSheet.png
     文件         425  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_article.png
     文件        1232  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_button.png
     文件         196  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_cell.png
     文件         838  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_dialog.png
     文件         924  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_feedback.png
     文件        1391  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_flow.png
     文件         200  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_form.png
     文件        1735  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_icons.png
     文件         357  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_layout.png
     文件         924  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_msg.png
     文件         579  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_nav.png
     文件         669  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_panel.png
     文件         548  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_progress.png
     文件        1068  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_search.png
     文件        1445  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_search_bar.png
     文件         495  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_special.png
     文件         521  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_tab.png
     文件         701  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_toast.png
     文件         388  2018-11-15 02:44  simple-multithreading-httpserver-master\WWWROOT\example\images\icon_nav_z-index.png
............此处省略38个文件信息

评论

共有 条评论