This is a Simple Sever and Client I created while following this tutorial C/C++ Sockets Tutorial. The goals of this project were to get back into C++ and learn about sockets and designing servers.
Build the project
cmake --build cmake-build-debug --target simple-socket-server
cmake --build cmake-build-debug --target simple-socket-client
move into the build directory
cd cmake-build-debug
Set the executable bit on the executables
chmod +x simple-socket-server
chmod +x simple-socket-client
move the executables to a better location
mv simple-socket-* [some location]
Compiled on Debian kernel version 5.16.11-76051611-generic arch x86_64
Note: if you are compiling the code you can skip the first 3 steps as they are performed above
Change directory to built
cd built
Set the executable bit to the executables
chmod +x simple-socket-server
chmod +x simple-socket-client
move the executables to a better location
mv simple-socket-* [some location]
Move to the directory you placed the executables in \
Run some commands
./simple-socket-server 5546
Note: if you placed the executable in PATH you do not need the proceeding ./
In a new terminal
./simple-socket-client 127.0.0.1 5546
Note: if you placed the executable in PATH you do not need the proceeding ./
I have started reading the following after completing this tutorial
- Internetworking with TCP/IP Volume One 6th Edition
- TCP/IP Sockets in C, 2nd Edition by Michael J. Donahoo, Kenneth L. Calvert
- Fork off new Processes to handle multiple connections
- Implement a fix for the zombie problem the above step will assuredly create
- Complete this project by having the server take a screenshot of the current desktop environment and pass it to the client.