Skip to content

Instantly share code, notes, and snippets.

@loantonusi
loantonusi / multithreaded-bind.c
Created February 15, 2017 21:43 — 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)
{