Kia.celever
Kia.celever

Reputation: 635

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

How can I have multiple connections over a single port in boost asio?

Do I need to have a socket for each client?

Upvotes: 4

Views: 2416

Answers (2)

arman_aegit
arman_aegit

Reputation: 435

Make a vector of asio socket*. Then work with that.For each client you want to accept push back a new socket.Hope this work!!

Upvotes: 0

Some programmer dude
Some programmer dude

Reputation: 409166

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

Upvotes: 7

Related Questions