Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: TcpListener  (Read 1943 times)

0 Members and 1 Guest are viewing this topic.

lorence30

  • Full Member
  • ***
  • Posts: 124
    • View Profile
    • Email
TcpListener
« on: October 29, 2015, 04:45:22 pm »
can someone explain me how the TcpListener socket is waiting a connection by this

sf::TcpListener server;
server.listen(5000); // listens on port 5000
sf::TcpSocket socket;
server.accept(socket); // how does the server wait by doing this and accept automatically when a tcpsocket is attempting to connect to port 5000

i just want to understand it




https://github.com/SFML/SFML/blob/master/examples/sockets/TCP.cpp
after i read this, i realized that i really did something wrong