Skip to content

A bare minimum TCP server using kqueue, to learn how kqueue works.

Notifications You must be signed in to change notification settings

ThomasPokorny/kqueue-tcp-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Example TCP server that uses kqueue(2)

This is a bare minimum TCP server that can be used to learn how kqueue(2) works. The code contains comments on what each section of code does.

The example in tcpserver_kqueue_callback.c contains a two functions which are executed once data can be read from a client connection.

Run

make event-loop

./tcpserver_kqueue

Now connect to the server at port 1815. For instance, using netcat:

nc -v localhost 1815

Run callback example

make event-loop-callback

./tcpserver_kqueue_callback

Now connect to the server at port 1816. For instance, using netcat as is presented in the section above

About

A bare minimum TCP server using kqueue, to learn how kqueue works.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.1%
  • Makefile 1.9%