Author Topic: SendQuickly  (Read 2187 times)

fretnoize

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
SendQuickly
« on: June 12, 2014, 03:00:57 AM »
I have a few questions about SendQuickly.
1) According to the docs, "Send a remote function call via UDP (if possible)." Does this mean it uses TCP when a UDP connection hasn't been established?

2) Is there reliability built into this? Searching around I found an old Unity forum post about TNet and rUDP, talking about the possibility of you adding it or something, but it seemed too old to know what happened. (2012 or so)

3) Is there a way to turn reliability on and off, if it exists? or should you just use Send if you need it to be reliable? Since our project is action based, I'm obviously looking to implement things for the best performance.

djray2k

  • Jr. Member
  • **
  • Thank You
  • -Given: 4
  • -Receive: 4
  • Posts: 74
  • Blockey Hockey!
    • View Profile
    • Walking Talking Grilling Bear Studios
Re: SendQuickly
« Reply #1 on: June 12, 2014, 01:04:04 PM »
It does use TCP instead of UDP if it hasn't been established.

I might be speaking out of my butt, but I was under the impression the point of TCP was to make sure it was reliable. Also meaning that it couldn't just be turned off or on.

fretnoize

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: SendQuickly
« Reply #2 on: June 12, 2014, 08:27:15 PM »
As I understand, TCP is, by nature, reliable. I was asking if there is any reliability built in for UDP RFCs and if it can be toggled on/off or whatnot.

To be honest, I'm not sure if rUDP (reliable UDP) messages would have a performance advantage over TCP messages, so that would be nice to know too.

I'd like to know if with SendQuickly with a UDP established will have a chance of not being received, which is why I'm asking if there's reliability built on UDP... (from what I read, that's the way Unity's Networking handles RPCs, with rUDP). Obviously it might be nice to be able to have both reliable and unreliable UDP...

(then again, maybe I'm over thinking things... still new to networking/coding for multiplayer games)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: SendQuickly
« Reply #3 on: June 13, 2014, 06:24:53 AM »
SendQuickly sends the message over UDP, if possible. If not possible, it falls back to TCP.

SendQuickly is ideal for frequent packets such as position updates, where each new packet safely overwrites the state of the previous one.

If you want something to arrive reliably, use tno.Send. If you don't care, and you are sending this packet frequently, use tno.SendQuickly.