1
Network / Three general questions about networking in SFML
« on: January 20, 2009, 07:50:55 pm »
Ok, I think I'm getting the hang of it. To put it in a fewer words; you create a TCP and/or UDP, connect it to a server, and then let each socket handle both the sending and receiving messages, preferably in its own thread.
Although, what is the best way of sending and receiving messages simultaneously? Is it to set the sockets on non-blocking mode and let them switch between:
checking if there is anything to send and send it.
and...
checking if there is any messages to receive?
Or is it possible to copy an already connected socket and to let one of them send data, and the other (in another thread) receive data?
Although, what is the best way of sending and receiving messages simultaneously? Is it to set the sockets on non-blocking mode and let them switch between:
checking if there is anything to send and send it.
and...
checking if there is any messages to receive?
Or is it possible to copy an already connected socket and to let one of them send data, and the other (in another thread) receive data?