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

Author Topic: Proper UDP communication questions  (Read 4318 times)

0 Members and 1 Guest are viewing this topic.

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
Proper UDP communication questions
« on: January 07, 2010, 06:29:43 pm »
Hey there,

I'd like to use UDP for my game in favor of TCP but I hit some roadblocks and like to ask questions about those here.

First, how would I use selectors with UDP since I have no connected selection between server and client which can determine which packages to get. Do selectors in UDP even make sense?

Then, how can I have easy two-way communication using UDP? To my understanding, I need open, bound and forwarded ports on both sides which is inconvenient for Internet play. How do others solve this problem with UDP?

Thanks in advance.

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
Proper UDP communication questions
« Reply #1 on: January 20, 2010, 10:04:59 pm »
So, any help? :)

gmagno

  • Newbie
  • *
  • Posts: 4
    • View Profile
Proper UDP communication questions
« Reply #2 on: March 24, 2010, 05:22:26 pm »
Hello Svenstaro,

I am new with SFML, but reading the tutorials I found selectors interesting when you want to receive packets on several sockets, you don't need threads (I think this might be interesting on the server side when listening to several clients). Another thing, which I'm not sure, selectors allow you to block a receive call for a certain timeout.

You can find this information here: http://www.sfml-dev.org/tutorials/1.5/network-selector.php

I will let other people to answer your other questions since I'm not an expert. I hope I helped some how.

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
Proper UDP communication questions
« Reply #3 on: March 25, 2010, 06:43:33 am »
Hello,

I know this is not the subject, but why choose UDP if you have so many questions ? UDP is different from TCP, if you want something more like TCP, use it ;)
Mindiell
----