title: Should I use TCP or UDP?
body: <p>My application needs to send video data frame by frame from Server to Client.
  I'm wavering between using TCP or UDP.</p>
  
  <p>From my test, I found out some following results:</p>
  
  <p>TCP: Very easy to implement.</p>
  
  <p>UDP: To send a frame (about 50KB) to Client, if I create 1 UDP package for each frame then the sending always loses frames. So I must divide each frame into many UDP packages. This makes my algorithm much more sophisticated because UDP protocol can lose packages and the packages can be delivered out of order.
  In addition, if the length of data in each UDP package is large then it is easily lost.</p>
  
  <p>I have some questions:</p>
  
  <ol>
  <li><p>Should I use TCP or UDP for this type of application.</p></li>
  <li><p>If I want to use UDP for faster transmission, how to determine the suitable length of data in each package that won't be lost easily while transmission? (this maybe belong to network bandwidth)?</p></li>
  <li><p>From your experiences, can you estimate how much percent is TCP faster UDP?</p></li>
  </ol>
  
  <p>Sorry for so many questions in a post, but I need to know more details before deciding whether to use TCP or UDP in my application.</p>