G
G
Gleb2020-11-28 12:40:02
Computer networks
Gleb, 2020-11-28 12:40:02

How to write an echo server?

Task: Based on the parallel echo server template (one client - one thread), write a chat server for exchanging text messages between an arbitrary number of nodes. Modify to work with a chat server. Use the UDP protocol.
I opened Stevens' book "UNIX Network Application Development" and couldn't find a parallel UDP echo server pattern.
What are the steps in writing? I can't find what I need in the book.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Griboks, 2020-11-28
@Griboks

Because the server must operate over UDP, no connection is established between the client and the server. Because of this, all incoming messages look the same for the UDP server, and the separation into clients occurs at the application level. Therefore, it is not possible to dedicate a thread to handle the UDP messages of each client.
On the other hand, perhaps it was a question of a large number of messages. In such a situation, it makes sense to allocate several concurrent message processing queues for each client.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question