C ++ Boost Asio: How do I have multiple clients?

How can I have multiple connections on the same port in boost asio?

Do I need to have a socket for each client?

+4
source share
2 answers

When a new connection is accepted, a new socket will be created for it, you do not need to create sockets yourself. Have you checked the examples in the manual? Like a chat server, I think it handles multiple connections.

+7
source

Make asio * socket vector. Then work with it. For each client you want to accept, release a new socket. Hope for this job!

0
source

Source: https://habr.com/ru/post/1379619/


All Articles