Skip to content

A single-threaded TCP server with an event loop using the poll system call written in C.

Notifications You must be signed in to change notification settings

biraj21/tcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TCP Server in C

This is a basic single-threaded TCP server with an event loop using the poll system call, written in C, without any third-party library. The server listens on a port and echoes back received data. I've also written a simple client to test the server.

For details on the resources utilized in this project, please refer to the section provided below.

How to run

  1. Clone the repository

  2. Compile client and server programs (don't worry, there's a Makefile to do this for you)

    make
  3. Run the server (it will run on port 3001)

    ./bin/server
  4. Run the client in another terminal

    ./bin/client
  5. Type something in the client terminal and press enter. You should see the server echoing back what you typed.

  6. Ctrl+C to stop the server and client.

Resources

About

A single-threaded TCP server with an event loop using the poll system call written in C.

Resources

Stars

Watchers

Forks