Simple Sockets

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.

Compiling the Code

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]

Running the pre-complied versions

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-server 127.0.0.1 5546 Note: if you placed the executable in PATH you do not need the proceeding ./

Further Reading

I have started reading the following after completing this tutorial

Future Plans for the Project

  1. Switch this project over to datagram sockets
  2. Fork off new Processes to handle multiple connections
  3. Implement a fix for the zombie problem the above step will assuredly create
  4. Complete this project by having the server take a screenshot of the current desktop environment and pass it to the client.

GitHub

View Github