Skip to content

Instantly share code, notes, and snippets.

@eXpl0it3r
Created August 18, 2014 19:42
Show Gist options
  • Save eXpl0it3r/9a2924111c72661a7d1b to your computer and use it in GitHub Desktop.
Save eXpl0it3r/9a2924111c72661a7d1b to your computer and use it in GitHub Desktop.
SFML/bugfix/socket_selector
#include <SFML/Network.hpp>
#include <SFML/System.hpp>
#include <iostream>
#include <winsock.h>
int main()
{
std::vector<sf::UdpSocket*> sockets;
sf::SocketSelector selector;
for(unsigned int i = 0; i < 1000; ++i)
{
sockets.push_back(new sf::UdpSocket());
sockets.back()->bind(55000+i);
selector.add(*sockets.back());
sf::err() << " " << i << "/" << FD_SETSIZE << std::endl;
}
for(unsigned int i = 0; i < 1000; ++i)
{
delete sockets[i];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment