Reputation: 635
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
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
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