Skip to content

A simple multi-threaded TCP socket server implemented in C with epoll for efficient I/O multiplexing, supporting concurrent client connections.

License

Notifications You must be signed in to change notification settings

a1383n/socket_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TCP Socket Example with Multi-Threading using Epoll

This project provides a simple TCP socket server example implemented in C, demonstrating multi-threading using epoll for efficient event handling. It serves as a sample project to understand basic socket programming concepts.

Using Make

  1. Clone this repository.
  2. Navigate to the project directory.
  3. Run make to build the server executable using GCC directly.
  4. Run executable: ./server

Using CMake

  1. Ensure you have CMake installed on your system.
  2. Clone this repository.
  3. Navigate to the project directory.
  4. Create a build directory: mkdir build && cd build.
  5. Run CMake: cmake ...
  6. Build the project: cmake --build ..
  7. Run executable: ./socket_example

Usage

  1. After building the project, run the executable generated.
  2. The server will listen for incoming connections on port 3000.
  3. Connect to the server using a TCP client (e.g., telnet, netcat).
  4. Send messages to the server, and it will echo them back.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.

License

This project is licensed under the GPL-3 License. See the LICENSE file for details.

About

A simple multi-threaded TCP socket server implemented in C with epoll for efficient I/O multiplexing, supporting concurrent client connections.

Topics

Resources

License

Stars

Watchers

Forks