0 Star 0 Fork 1

RunCoder/HttpServer

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
HttpServerOne.java 764 Bytes
一键复制 编辑 原始数据 按行查看 历史
RunCoder 提交于 2018-06-06 10:47 +08:00 . init project
package com.httpserver.one;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
/**
*@project:HttpServerDemo
*@author wuhn
*@version 1.0
*@createTime:2017年9月18日 下午12:23:37
*@description: 研究下web服务器的源程序
*/
public class HttpServerOne {
public static String ROOT="./WebContent";
public static String defaultPage="index.html";
public static void main(String[] args) throws IOException {
@SuppressWarnings("resource")
ServerSocket server =new ServerSocket(8000);
while(true){
final Socket socket = server.accept();
System.out.println("accepting connection ...\n");
//启动服务线程
new HttpThread(socket).start();
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/RunCoder/HttpServer.git
git@gitee.com:RunCoder/HttpServer.git
RunCoder
HttpServer
HttpServer
master

搜索帮助