Client/Server application for dynamic text communication.
Task:
- client and server has to start communication via port 7300.
- server can request to change communication port in any time.
- client also can request to change communication port in any time.
Ex: Communication established via port 7300.
- Text messages can go in both directions.
- To change communication port client or server has to send message "NewPort-"
- Client or server has to replay "success" or "failure"
- In case of success communication will be re-established via New port
WAS NOT IMPLEMENTED:
Bonus option: communication port must be changed each 45 seconds without user disturbing.
How to build project:
server side:
cd server/
- Run
cmake .
- run
make
client side:
cd client/
- Run
cmake .
- Run
make
Work with server/client:
- To start server/client run
./server <port_number>
E.g:./server 7300
E.g:./client 7300
Note: client always sends messages to server first. - To change port enter on either side
NewPort-<port_number>
command.
Note: port number must be numberical value in range from 1024 to 49151. - To stop either side enter
Stop
command.
Note: If client disconnected, server will keep listening to new connections. If server disconnected, client will also stop working.
Note: You cannot sendStop
command on server if it doesn't have any active client connections.
Note: Clinet can recconect with relevant server port executing./client <port_number>