#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
int main(){
sf::TcpListener listener;
// bind the listener to a port
if (listener.listen(53003) != sf::Socket::Done)
{
// error...
}
// accept a new connection
sf::TcpSocket client;
if (listener.accept(client) != sf::Socket::Done)
{
// error...
}
char data[100];
std::size_t received;
// TCP socket:
if (client.receive(data, 100, received) != sf::Socket::Done)
{
// error...
}
std::cout << "Received " << received << " bytes" << std::endl;
}