This PR introduces a C++ program that combines both server and client functionalities in a single file. The user can choose whether to run the program as a server or client at runtime.
The Server class initializes the server, accepts client connections, and handles communication.
The Client class initializes the client, connects to the server, and handles message exchange.
The program provides an interactive prompt for selecting either the server or client mode, then proceeds with the respective functionality.
This PR provides a basic example of how to implement a simple server-client architecture in C++ using object-oriented programming (OOP). It can be useful for educational purposes or as a base for more complex networking programs.
Checklist before requesting a review
[x] If it is a core feature, I have added thorough tests.
[x] My code follows the style guidelines of this project.
[x] I have performed a self-review of my code.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] I have made corresponding changes to the documentation.
[x] I have only one commit (if not, squash them into one commit).
Combined Server-Client Program in C++
Describe your changes
This PR introduces a C++ program that combines both server and client functionalities in a single file. The user can choose whether to run the program as a server or client at runtime.
Server
class initializes the server, accepts client connections, and handles communication.Client
class initializes the client, connects to the server, and handles message exchange.This PR provides a basic example of how to implement a simple server-client architecture in C++ using object-oriented programming (OOP). It can be useful for educational purposes or as a base for more complex networking programs.
Checklist before requesting a review