Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Efficient network server design examples, written in C [closed]

I am interested in learning how to write extremely efficient network server software and I don't mind getting my hands dirty with pointers, sockets and threading. I'm talking a server being able to handle thousands of concurrent connections. There is not much processing for each client, but a little.

Do you know of any code examples for really efficient network servers?

Optionally points for small, well documented code that is cross-platform as well.

like image 969
Andrioid Avatar asked May 07 '09 12:05

Andrioid


Video Answer


4 Answers

You'll find a lot of good references and discussion about building highly scalable network servers on Dan Kegel's The C10K problem page.

like image 150
Lance Richardson Avatar answered Sep 21 '22 17:09

Lance Richardson


Have a look at nginx, lighttpd and varnish for some popular high performance http servers.

BTW, I am currently working on combining edge-triggered epoll with multithreading (plus user-level swapcontext-style threads/fibers) - see http://svn.cmeerw.net/src/nginetd/trunk/ for some work-in-progress code (although this one is written in C++).

like image 39
cmeerw Avatar answered Sep 21 '22 17:09

cmeerw


This may not be exactly what you are looking for, but I briefly recall looking at Space Tyrant a few years back and thinking it sounded cool.

http://librenix.com/?inode=6240

Hope it helps!

like image 32
Speedy Avatar answered Sep 21 '22 17:09

Speedy


Read this

http://www.evanmiller.org/lxr/http/source/

like image 24
S.Lott Avatar answered Sep 17 '22 17:09

S.Lott