136
Network / Handling Multiple TCP Connections
« on: December 23, 2010, 12:58:28 am »
I'm not sure what you want to know... It's exactly the same as sending something to all clients except the sender. Skip over then in a client array.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
if (Socket == Listener)
{
// If the listening socket is ready, it means that we can accept a new connection
sf::IPAddress Address;
sf::SocketTCP Client;
Listener.Accept(Client, &Address);
std::cout << "Client connected ! (" << Address << ")" << std::endl;
// Add it to the selector
Selector.Add(Client);
}
sf::IPAddress Address;
sf::SocketTCP Client;
Listener.Accept(Client, &Address);
std::cout << "Client connected ! (" << Address << ")" << std::endl
#include vector
//other includes here
std::vector<sf::SocketTCP> Clients;
sf::SocketTCP Clients[10];