Lab 6. Network programming
Make a program that implements a given network service. It should be able to serve many clients at the same time. Make two versions of the server from the list: one TCP server, the other - web socket server (a couple of technologies must be different for different students; ask the teacher if your chosen pair is not already taken):
- C++ threads with blocking sockets (sample)
- C++ poll with multiplexed I/O (sample)
- C++ epoll (extended poll) with the O(1) complexity of the algorithm (sample)
- C++ ASIO - asynchronous I/O - uses Boost (sample)
- C++ websocket server on Qt (sample)
- incorrect: C# with non-blocking sockets (sample - is incorrect, you need to rewrite according to the article - for the CALC protocol like all other examples)
- Ruby (sample of TCP-server; sample of websocket server)
- Python (sample TCP-server; sample websocket server )
- Java (sample of TCP-server based on Netty library, sample of websocket server based on Jetty library)
- Php (sample of TCP-server; sample of websocket server)
- Golang (sample of TCP-server based on threads, sample of TCP-server based on events (epoll), sample of websocket server based on threads)
- Rust (sample of TCP-server based on threads, sample of websocket server)
- Haskell (sample of TCP-server, sample of websocket server)
- Kotlin (sample of TCP-server; sample of websocket server)
- Scala (sample of TCP-server)
- Another, without an example (but one) for the CALC protocol from the lecture or a websocket server in a programming language for which there is no example (python curio, etc.) or rewrite incorrect C# example
These technologies should be used only when writing a server program. As a client program, use telnet for the TCP server case and this web page for the websocket server case.
In all tasks, clients connect to the server, communicate for a long time: they send requests, receive responses and disconnect. Implement the possibility of request pipelining: the client sends one or more requests before receiving a response to the previous one.
Think up and describe the format of messages sent by clients and server responses to these messages (i.e. protocol).
Your variant of the task was sent to you by email. If not, contact the lecturer.
The completed task must be shown to the teacher in class and then upload the solution to Moodle.An additional 3 points in network administration are given to those who prepare two docker containers for their servers, which, when they are launched, must compile (if necessary) and run the corresponding server.