I asked this, recently, on the IRC channel.
Please bare with me. Understand, I can't think for shit, and I have to start the discussion from scratch, in terms I can understand. Please state things naturally, as you naturally would, and with the understanding that I have searched the forums and Google for things related to this question. I just need to ask specifics, in order to get the answer for which I am searching.
I have a problem. I'm trying to use sfml-network. I also have short-term memory loss. I need someone willing to break out the crayons and spell things out for me, Barney style. I've read manuals, I've passed Networking 101+ classes. I just need some simple yes-or-no questions to be answered for a vet who can't remember how to tie his own shoes. Is there a place for me?
I'm trying to use sfml-network to run five threads. One accepts incoming connections. One accepts incoming packets from already-connected sockets (clients). One processes all logic for the server (unrelated to discussion, obviously), another sends all pending outgoing connections. The fifth thread will end all connections that haven't sent a heartbeat within the last x [time], or have been queued for logout. Also unrelated, there is a sixth, seventh, and eighth thread for connecting to the database and doing everything pending in the database thread.
Anyway, the question is, this:
Is this sufficient for an incoming socket?
if (listener.listen(53000) != sf::Socket::Done)
? So, from here, the server inserts the socket into a vertex, ofc, and then loops for incoming packets in the next thread.
Also, is this sufficient for merely looping and accepting incoming packets from already-connected clients?
if (Socket.Receive(Packet) == sf::Socket::Done)
When the server receives a packet, it parses it, but is it sufficient to just loop the thread until the packet received is for an already-connected client?
Can the multiple threads keep looping and checking for the different things, on the server? That is, incoming clients, client packets for those already connected, timeouts for for already connected?
Or, do I really need to make them all non-blocking and deal with the thousands of loops per second?