Skip to content

Instantly share code, notes, and snippets.

@ckyoog
ckyoog / multithreaded-bind.c
Created November 21, 2019 22:07 — forked from carun/multithreaded-bind.c
Sample code to illustrate multiple threads binding on the same port using SO_REUSEPORT option introduced in kernel 3.9. Here is the LWN article on the same https://lwn.net/Articles/542629/
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include <arpa/inet.h>
#include <pthread.h>
void* do_work(void *arg)
{

Keybase proof

I hereby claim:

  • I am ckyoog on github.
  • I am ckykey (https://keybase.io/ckykey) on keybase.
  • I have a public key ASBYewvSJLd9T_D_Dx0W50Dx7rwAbKe2LIagZffOskTPQgo

To claim this, I am signing this object: