All Projects → flouthoc → Envelop.c

flouthoc / Envelop.c

Licence: mit
🌊 Thread-less, event-loop based tiny http-server from scratch using epoll. Learning Purpose.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Envelop.c

Mongols
C++ high performance networking with TCP/UDP/RESP/HTTP/WebSocket protocols
Stars: ✭ 250 (+233.33%)
Mutual labels:  epoll, http-server
fancy
High performance web server
Stars: ✭ 20 (-73.33%)
Mutual labels:  http-server, epoll
Lotos
tiny but high-performance HTTP Server
Stars: ✭ 140 (+86.67%)
Mutual labels:  epoll, http-server
Libhv
🔥 比libevent、libuv更易用的国产网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket client/server.
Stars: ✭ 3,355 (+4373.33%)
Mutual labels:  http-server, epoll
Gnet
🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go./ gnet 是一个高性能、轻量级、非阻塞的事件驱动 Go 网络框架。
Stars: ✭ 5,736 (+7548%)
Mutual labels:  event-loop, epoll
Mgx
🌈 A high performance network framework written in c++ (support tcp and http)
Stars: ✭ 15 (-80%)
Mutual labels:  http-server, epoll
WebServer
High-performance multi-threaded tcp network server in c++11
Stars: ✭ 58 (-22.67%)
Mutual labels:  http-server, epoll
Zaver
Yet another fast and efficient HTTP server
Stars: ✭ 673 (+797.33%)
Mutual labels:  epoll, http-server
Webserver
A C++ High Performance Web Server
Stars: ✭ 4,164 (+5452%)
Mutual labels:  epoll, http-server
toyhttpd
I/O 模型练手代码,分别使用阻塞式 I/O、select、poll 和 epoll 和 Java NIO 实现了简单的 HTTP Server
Stars: ✭ 43 (-42.67%)
Mutual labels:  http-server, epoll
Facebooc
Yet another Facebook clone written in C
Stars: ✭ 483 (+544%)
Mutual labels:  epoll, http-server
Webcpp
用C++开发web服务器框架
Stars: ✭ 23 (-69.33%)
Mutual labels:  epoll, http-server
Vtx clientserver
VTX Client / Server package.
Stars: ✭ 60 (-20%)
Mutual labels:  http-server
Akka Http
The Streaming-first HTTP server/module of Akka
Stars: ✭ 1,163 (+1450.67%)
Mutual labels:  http-server
Httpserver
A high performance, single threaded, HTTP server written in C++ as a learning tool. Uses kqueue for event management, therefore is MacOS / *BSD only!
Stars: ✭ 59 (-21.33%)
Mutual labels:  http-server
Esp8266
This repository contains source code for the ESP8266.
Stars: ✭ 58 (-22.67%)
Mutual labels:  http-server
Streamit
This iOS app streams your camera so you can watch it in a simple web browser (MJPEG stream)
Stars: ✭ 74 (-1.33%)
Mutual labels:  http-server
Merecat
Small and made-easy HTTP/HTTPS server based on Jef Poskanzer's thttpd
Stars: ✭ 69 (-8%)
Mutual labels:  http-server
Foxy
Session-based Beast/Asio wrapper requiring C++14
Stars: ✭ 57 (-24%)
Mutual labels:  http-server
Gev
🚀Gev is a lightweight, fast non-blocking TCP network library based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers.
Stars: ✭ 1,082 (+1342.67%)
Mutual labels:  epoll

envelop.c

Thread-less, event-loop based toy http-server from scratch. This project focuses on practical implementation of EPOLL for learning purpose.

drawing

Build

gcc -o envelop envelop.c
Starts server on default port: 3000
./envelop

Hit

http://127.0.0.1:3000/hello

Add your own Routes

See the Routes function Here

What is event-loop ?

Its an infinite loop which looks for any available events and performs required action on them.

Psuedo Code for event loop.
for (1){

	event = getReadyEvents();
    if(event == "task1"){
    	perform task1;
    }else if(event == "task2"){
    	perform task2;
    }
}
Theory

is a programming construct that waits for and dispatches events or messages in a program. It works by making a request to some internal or external "event provider" (that generally blocks the request until an event has arrived), and then it calls the relevant event handler ("dispatches the event"). The event-loop may be used in conjunction with a reactor, if the event provider follows the file interface, which can be selected or 'polled' (the Unix system call, not actual polling). The event loop almost always operates asynchronously with the message originator.

Epoll

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].