All Projects → eatonphil → Referenceserver

eatonphil / Referenceserver

Licence: mit
Barebones UNIX socket servers

Programming Languages

c
50402 projects - #5 most used programming language

Barebones UNIX socket servers

I find myself writing this server in some language every few months. Each time I have to scour the web for a good reference. Use this as a reference to write your own bare server in C or other languages with a UNIX API (Python, OCaml, etc).

Run

make build-c
bin/cserver # go to localhost:15000

make build-ocaml
bin/ocamlserver # go to localhost:15000

make build-python
python2.7 bin/pythonserver # go to localhost:15000
# -- OR --
python3.5 python/server.py # go to localhost:15000

make build-sbcl
bin/sbclserver # go to localhost:15000

Notes

These servers are very minimal and require no external libraries. They may suffer from serious problems (reading/writing completely, blocking, single-threadedness, idiomaticness, etc). If you notice these issues, feel free to file an issue or create a PR. If a fix does not seriously impede on the simplicity of the example, the changes may be incorporated.

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].