Client-server application based on Linux sockets and written in C++ programming language.
The server is capable of connecting multiple clients and processing their requests.
main_server.cc
is specialized in such way that it can only process 3 types of commands:
connections
- return current number of connections to the servercount <message>
- count letters in the message and return it in the table formsend <message>
- send a message to all other connected clients
If you want to wtite down your own server - you can specialize server.h
server by providing ResponseProcessor
caller to the Serve
method.
The client is capable of connecting to the server once and sending/receiving data with it.
main_client.cc
is specialized to endlessly ask for command and send it to the server if it is correct. After each succesfull transaction to the server client checks for incoming messages from server or other clients.
cmake -B build src
cmake --build build
Server accepts only one command-line argument - port on which it will be serving.
./server 8888
Client accepts two command-line arguments: address and port. Instead of actual address localhost can be specified to connect to local instances of the server.
./client localhost 8888