The tiniest chat servers on earth!

Overview

yoctochat

The tiniest chat servers on earth!

Here will be a collection of the simplest possible TCP chat servers, to demonstrate how to write multiuser, multiplexing server software using various techniques.

The "spec"

A yoctochat server will:

  • take a single commandline argument, the port to listen on
  • open a listening port
  • handle multiple connections and disconnections on that port
  • receive text on a connection, and forward it on to all other connections
  • produce simple output about what its doing
  • demonstrate a single IO multiplexing technique as simply as possible
  • be well commented!

Why?

20+ years ago, during my University days, I started writing little chat servers like this to teach myself C, UNIX, systems programming, internet programming, and so on. I went on to write bigger and better ones. It has been useful knowledge!

Lately, I found myself wanting to experiment with io_uring, and I realised I'd forgotten how the "classic" select() loop is constructed. So I started there, and here we are!

You might also like...
An implementation of the Mobile Adapter GB protocol, to connect to custom game servers.

libmobile Library that implements the Mobile Adapter GB protocol, in a way that should be easy to integrate into a plethora of different emulators/har

StateAFL: A Greybox Fuzzer for Stateful Network Servers
StateAFL: A Greybox Fuzzer for Stateful Network Servers

StateAFL: A Coverage-Driven (Greybox) Fuzzer for Stateful Network Protocols StateAFL is a fuzzer designed for network servers. It extends the original

Provide translation, currency conversion, and voting services. First using telnet you create a connection to a TCP socket, then the server connects to 3 UDP sockets hosted on other servers to do tasks.

to run micro servers g++ translator.cpp -o translator ./translator port 1 g++ voting.cpp -o voting ./voting port 2 g++ currency_converter.cpp -o c

Webdav-client-cpp - C++ WebDAV Client provides easy and convenient to work with WebDAV-servers.

WebDAV Client Package WebDAV Client provides easy and convenient to work with WebDAV-servers: Yandex.Disk Dropbox Google Drive Box 4shared ownCloud ..

✔️The smallest header-only GUI library(4 KLOC) for all platforms
✔️The smallest header-only GUI library(4 KLOC) for all platforms

Welcome to GUI-lite The smallest header-only GUI library (4 KLOC) for all platforms. 中文 Lightweight ✂️ Small: 4,000+ lines of C++ code, zero dependenc

A C++ commandline for use in servers and chat software. Provides very simple asynchronous input/output.
A C++ commandline for use in servers and chat software. Provides very simple asynchronous input/output.

commandline A C++ commandline for use in servers and terminal chat software. Provides very simple asynchronous input/output. Supports reading and writ

Earth observation data cubes from GDAL image collections
Earth observation data cubes from GDAL image collections

gdalcubes - Earth observation data cubes from GDAL image collections gdalcubes is a library to represent collections of Earth Observation (EO) images

You must create a small 2D game where a dolphin escapes earth after eating some fish. ✅‎‎‎‏‏‎ ‎
You must create a small 2D game where a dolphin escapes earth after eating some fish. ✅‎‎‎‏‏‎ ‎

so_long Subject You must create a small 2D game where a dolphin escapes earth after eating some fish. Or any hero collects any valuables before leavin

Mumble is an Open Source, low-latency, high quality voice chat software
Mumble is an Open Source, low-latency, high quality voice chat software

Mumble is an Open Source, low-latency and high-quality voice-chat program written on top of Qt and Opus.

Ncurses TCP Chat
Ncurses TCP Chat

NCURSES Encrypted TCP Chat This is an encrypted chat via the command line! It was done using ncurses to build the whole user interface. I wanted to do

Unlocks the chat in Among Us

Among us external chat unlocker Among us external chat unlocker written in c++ Build flags for gcc -O2 -s -static-libstdc++ -static-libgcc Download Yo

A Google Chat protocol plugin for libpurple/Pidgin/bitlbee/whatever

Google Chat Plugin for libpurple A WORK IN PROGRESS replacement prpl for Google Chat in Pidgin/libpurple to support the proprietary protocol that Goog

📃 Export WeChat chat histories to HTML files.
📃 Export WeChat chat histories to HTML files.

wechat-export Export WeChat chat histories to HTML files. Preview This script generates a HTML file for each contact's chat history. Currently it supp

This is new projec based in apps to chat or messages people to people

Stranger This is new projec based in apps to chat or messages people to people Esta aplicacion tendra las siguientes caracteristicas: 1* Es 100% segur

A cross-platform SDK enabling developers to integrate real-time chat technology into their projects

4Players ODIN SDK ODIN is a cross-platform software development kit (SDK) that enables developers to integrate real-time chat technology into multipla

server secure chat

nem server api Register Login GetList Handshake Message Feed StatusOnline HandshakeKey HandshakeNotice FileAdd StorageFile GetFile Register { "type":

(bad) decentralized chat app

ircreborn what is this well. ircreborn was created because i felt that all the good platforms had too many paywalled features. (also because discord h

Simple local P2P chat on UDP sockets
Simple local P2P chat on UDP sockets

Local P2P Chat This is a fully decentralized chat. To communicate, simply run it on computers in a single local network (using one port). All messages

Comments
  • Implement kqueue implementation

    Implement kqueue implementation

    Hello! I didn't write C for a while and decided to give it a go after reading your article. Please review, maybe it can be useful for someone too I tried to follow the original style as much as possible.

    opened by delneg 3
Owner
Rob N ★
@fastmailops and stupid toys
Rob N ★
A Google Chat protocol plugin for libpurple/Pidgin/bitlbee/whatever

Google Chat Plugin for libpurple A WORK IN PROGRESS replacement prpl for Google Chat in Pidgin/libpurple to support the proprietary protocol that Goog

Eion Robb 90 Dec 26, 2022
A cross-platform SDK enabling developers to integrate real-time chat technology into their projects

4Players ODIN SDK ODIN is a cross-platform software development kit (SDK) that enables developers to integrate real-time chat technology into multipla

4Players 6 Dec 2, 2022
server secure chat

nem server api Register Login GetList Handshake Message Feed StatusOnline HandshakeKey HandshakeNotice FileAdd StorageFile GetFile Register { "type":

Dmitrii 6 Apr 3, 2022
Simple local P2P chat on UDP sockets

Local P2P Chat This is a fully decentralized chat. To communicate, simply run it on computers in a single local network (using one port). All messages

Anton Khalitov 18 Dec 8, 2022
Simple Tcp Chat Client / Server written in C++

What this TcpXat TcpXat Is A Simple Tcp Chat Setup TcpXat sudo apt install make;make client;make serv;echo "done by FuryM3m0ry"; How To Run TcpXat Ter

sami 1 Dec 28, 2021
C library to create simple HTTP servers and Web Applications.

Onion http server library Travis status Coverity status Onion is a C library to create simple HTTP servers and Web Applications. master the developmen

David Moreno Montero 1.9k Dec 20, 2022
Async & Concurrent Servers implemented in C

Concurrent servers in c Imlementation of concurrent severs in c from scratch using this awesome blog as a tutorial. Project Structure . ├── readme.md

Rupanshu Yadav 7 Jun 21, 2021
STARTTLS implementation for mail servers that don't have it.

smtpd-starttls-proxy - a STARTTLS implementation for mail servers ----------------------------------------------------------------- smtpd-starttls-p

Laurent Bercot 6 Dec 21, 2021
Husarnet is a Peer-to-Peer VPN to connect your laptops, servers and microcontrollers over the Internet with zero configuration.

Husarnet Client Husarnet is a Peer-to-Peer VPN to connect your laptops, servers and microcontrollers over the Internet with zero configuration. Key fe

Husarnet 180 Jan 1, 2023
This repository to emulate the progression on World of Warcraft (AzerothCore) based servers, from the version 3.0 to 3.3.5a

WoltkProgression Author: Silker This repository contains all the files required to emulate the progression on World of Warcraft private servers runnin

Silker 14 Dec 14, 2022