Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Network
»
UDP multiple ports
Print
Pages: [
1
]
Author
Topic: UDP multiple ports (Read 6505 times)
0 Members and 1 Guest are viewing this topic.
roccio
Jr. Member
Posts: 64
UDP multiple ports
«
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
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 11034
Re: UDP multiple ports
«
Reply #1 on:
August 21, 2018, 12:18:04 pm »
Yes, that's possible.
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
roccio
Jr. Member
Posts: 64
Re: UDP multiple ports
«
Reply #2 on:
August 21, 2018, 02:31:32 pm »
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?
Logged
dabbertorres
Hero Member
Posts: 505
Re: UDP multiple ports
«
Reply #3 on:
August 21, 2018, 06:35:53 pm »
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.
Logged
Github
roccio
Jr. Member
Posts: 64
Re: UDP multiple ports
«
Reply #4 on:
August 22, 2018, 06:42:13 pm »
Is it possible to mix UDP and TCP sockets?
Can I have one UDP socket and another TCP running at the same time?
Logged
dabbertorres
Hero Member
Posts: 505
Re: UDP multiple ports
«
Reply #5 on:
August 22, 2018, 07:26:07 pm »
Of course, and is relatively common. For example, DNS uses both UDP and TCP (port 53).
Logged
Github
Print
Pages: [
1
]
SFML community forums
»
Help
»
Network
»
UDP multiple ports