Code Monkey home page Code Monkey logo

lwebserver's Introduction

仿Tomcat简化版Servlet容器

通过搭建简单HTTP服务器,学习服务器原理和计算机网络知识

学习内容:

  • IO模式
  • Socket
  • TCP/IP
  • 框架源码(Tomcat,Spring,Netty等)
  • 高级网络编程
  • 线程模型

实现的简化功能:

  • BIO NIO AIO

NIO使用的是IO多路复用的Select机制

  • HTTP Protocol

Keep-Alive

  • Servlet

ServletContext Dispatcher

  • Request&Response

  • Forward&Redirect

  • session&cookie

使用技术

基于Java BIO/NIO/AIO(NIO2)、多线程(select)、Socket网络编程、XML解析、log4j/slf4j日志

模式

  • 当前NIO的实现参照的是Tomcat的源码

解决问题

  • AIO的高错误率,backlog参数的调节issue
  • NIO下对Socket实现长连接(keep-alive),并设置心跳定时清理
  • 分析多余的socket连接issue

准备添加的功能:

  • SSL
  • limtlatch
  • 辅Selector

博客

关于专栏-------WebServer二三事

WebServer二三事(一)Socket编程说起

WebServer二三事(二)五种网络I/O模式

同步/异步,阻塞/非阻塞你真的理解了吗?

lwebserver's People

Contributors

defineyida avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.