SFML community forums
Help => Network => Topic started by: roccio on August 21, 2018, 10:58:20 am
-
Hello, I would like to know if it is possible to have two udp sockets receiving on two different port at the same ipaddress.
Thanks
-
Yes, that's possible. :)
-
Ok, thank you.
Now I have another question for you masters ;)
I would like to send a quite big image over the net as fast as possible (it must be runtime). I have it compressed so it's like 120K, what's the best method?
It's ok to use UDP (datagram limit) or better go to TCP?
-
I recommend reading about the differences between both protocols.
But, in general, a (simplified) rule of thumb:
If you need perfect replication of the data (ie: a file), you use TCP.
If not, you can use UDP.
-
Is it possible to mix UDP and TCP sockets?
Can I have one UDP socket and another TCP running at the same time?
-
Of course, and is relatively common. For example, DNS uses both UDP and TCP (port 53).