Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Multiple clients  (Read 2185 times)

0 Members and 1 Guest are viewing this topic.

rgrant1993

  • Newbie
  • *
  • Posts: 12
    • View Profile
Multiple clients
« on: August 03, 2013, 08:32:31 pm »
I have found a tutorial on how to do multiple clients with SFML, but even i can see that the developer was lost in their own code. :)

I have crossed SFML documentation stating how to connect to multiple clients, but i strongly believe that it was for a earlier version of SFML. So how can we implement several clients to a server?

rgrant1993

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Multiple clients
« Reply #1 on: August 03, 2013, 08:38:57 pm »
I suppose this would also be known as socket selectors?

ahnonay

  • Guest
Re: Multiple clients
« Reply #2 on: August 03, 2013, 10:39:26 pm »
Yes, you can use SocketSelectors to read from multiple clients at once, but you don't have to. They just make things easier.
The documentation provides example code:
http://www.sfml-dev.org/documentation/2.1/classsf_1_1SocketSelector.php
Alternatively, you could just store your client sockets in a list and call receive on each of them.