Thread: Network Tables
View Single Post
  #19   Spotlight this post!  
Unread 01-04-2014, 13:05
JamesTerm's Avatar
JamesTerm JamesTerm is offline
Terminator
AKA: James Killian
FRC #3481 (Bronc Botz)
Team Role: Engineer
 
Join Date: May 2011
Rookie Year: 2010
Location: San Antonio, Texas
Posts: 298
JamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to behold
Re: Network Tables

Quote:
Originally Posted by apalrd View Post
I don't see how this can be true.

Assuming the data to send is the same size (which depends on implementation), UDP would in the real world send less data, as it never resends packets that failed. You are also sending images on the same ethernet link, so a few extra bytes or packets here or there really makes no difference.
I should post some benchmarks... I think I got the high band width from UDP because I used the DO_NOT_WAIT flag when creating the socket. So perhaps it would be less, but I have yet to see confirmation of that.

Quote:
Originally Posted by apalrd View Post
I don't see how this can be true.
In either case, you need a listener somewhere to read all of the packets from the buffer. Network Tables already created a thread to do this, with UDP you are doing it on your own.
Needing a listener somewhere is not the same as needing a listener that is on its own dedicated thread listening even at startup. When I first dinked around with UDP I used WinSock2 for everything, and could set the options as such where I didn't need to make a new thread... this was great and kept the code simple. I then transfer this same code to VxWorks and saw the fireworks... the driver station would repeatedly lose connection and get it back. The UDP buffer overflowed and corrupted the TCPIP packets.

So ... you don't need to have a dedicated thread if you are using WinSock2, but for VxWorks, and the original WinSock... you do.