Skip to content
Example of network communications and pthread vs. select concurrency in C
C
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
Makefile
client.c
readme
server_multi_threaded.c
server_select.c
server_single_threaded.c

readme

echo_chat
Matt Nichols, Snow Li (man1, snowli)

echo_chat consists of several simple C programs, written to demonstrate TCP socket communications in C, as well as the implementation of basic concurrency using both pthreads and the select syscall.

The client uses a pthread for each sending and receiving messages from the server. There are three different servers: one uses select to handle many concurrent socket connections from different clients, one uses multiple threads, and one uses a single thread (non-concurrent). Messages are limited to 256 bytes in size, for simplicity.

Usage:
  client server_hostname port
  server listening_port
Something went wrong with that request. Please try again.