1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-09 12:22:34 +01:00

Accept incoming connections in a loop

This commit is contained in:
Timmy Sjöstedt 2015-04-25 01:08:19 +02:00
parent fc0777717e
commit dc9c4c3b72

View File

@ -15,6 +15,7 @@ void HttpServer::run()
std::cout << "STARTING HTTP SERVER" << std::endl;
while (true) {
sf::TcpSocket client;
if (listener.accept(client) == sf::Socket::Done) {
std::cout << "New connection from "
@ -32,6 +33,7 @@ void HttpServer::run()
client.disconnect();
}
}
listener.close();
}