A low-level network server written in C with a Python client interface used to interact with the server through command-line commands. This project focuses on implementing core systems programming concepts such as socket communication, event-driven I/O, thread pools, and custom data structures.
The project demonstrates how a backend service can be built from the ground up without relying on high-level frameworks.
new_server is a systems programming project designed to explore how scalable servers are built internally. The server is written in C and handles networking, concurrency, and packet processing manually.
A Python client provides an interactive command interface that allows users to connect to the server, send commands, and interact with server functionality.
This project highlights experience with:
- Linux systems programming
- TCP socket communication
- Event-driven server architecture
- Concurrent processing using thread pools
- Custom data structures
- Binary packet serialization
- Client/server communication
new_server/
│
├── include/ # Header files
│ ├── epoll_lib.h
│ ├── error_handler.h
│ ├── hashmap.h
│ ├── linked_list.h
│ ├── server_core.h
│ ├── server_limits.h
│ ├── server_packet.h
│ ├── server_utils.h
│ ├── threadpool.h
│ └── user_lib.h
│
├── src/ # Server source code
│ ├── epoll_lib.c
│ ├── error_handler.c
│ ├── hashmap.c
│ ├── linked_list.c
│ ├── main.c
│ ├── server_core.c
│ ├── server_packets.c
│ ├── server_utils.c
│ ├── threadpool.c
│ └── user_lib.c
│
├── client.py # Python client interface
├── commander.py # Command shell implementation
├── Makefile # Build automation
├── server_plan # Design notes
└── test.sh # Basic test script
The server is implemented entirely in C using modular components.
Uses Linux epoll for efficient socket monitoring and event-driven I/O.
A thread pool allows concurrent handling of client requests.
Communication between the Python client and server uses binary packet structures.
The architecture supports session and user handling through a dedicated user library.
The project implements internal data structures including:
- Hash maps
- Linked lists
A Python command-line interface allows users to interact with the server.
- C
- POSIX sockets
- epoll
- pthreads
- GNU Make
- Linux system libraries
- Python 3
- socket
- struct
- cmd module
- Bash scripts
- The server listens for incoming TCP connections.
- Clients connect using the Python client interface.
- Commands are sent from the client using binary packets.
- The server processes requests using worker threads.
- Responses are returned to the client.
The architecture combines:
- epoll-based socket management
- thread pools for concurrency
- modular server components
- Linux
- GCC
- Make
- Python 3
Run:
make
make debug
make clean
Start the server:
./capstone
Run the Python client:
python3 client.py
Specify IP and port if needed:
python3 client.py -i 127.0.0.1 -p 4567
Example commands:
connect
login <username> <password>
logout
quit
Example session:
$ python3 client.py -i 127.0.0.1 -p 4567
Successfully connected to 127.0.0.1:4567
> login admin password
> logout
> quit
A basic testing script is included:
./test.sh
This script repeatedly launches the client for simple testing.
This project explores low-level server architecture concepts including:
- Socket programming
- Event-driven networking
- Concurrent request processing
- Custom protocol design
- Modular server design
The goal was to gain a deeper understanding of how backend services function at the systems level.
Possible improvements include:
- TLS encrypted communication
- Improved authentication
- Structured logging
- Docker containerization
- CI/CD integration
- Automated testing
- Performance benchmarking
This project demonstrates experience with:
- Linux systems programming
- Network protocol design
- Concurrent server architecture
- Data structure implementation
- Client/server communication
This project currently does not include a license. Consider adding an open-source license such as MIT or Apache 2.0 if you plan to distribute the code.