Created
August 18, 2014 19:42
-
-
Save eXpl0it3r/9a2924111c72661a7d1b to your computer and use it in GitHub Desktop.
SFML/bugfix/socket_selector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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