Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCP\IP vs. UDP.

Status
Not open for further replies.

VBCoder968

Programmer
Mar 4, 2003
2
US
Hey, i use Winsock a lot just playing
around with internet programming and
was wondering which is faster TCP\IP?
Especially on a app that transmits a lot
of data frequently like a app that
sets the mouse position on another computer
to your mouse position for example.

I could use this information so that
i can make dependable stuff in future applications.

Thanks.
 
My understanding is feeble, but UDP is best used where a missed packet won't be missed, (if you do not get a mouse position, but you get the next one, does it matter in your application?)

TCP is best used where information larger than one packet must be delivered reiably though several packets. If all mouse clicks Must be applied in order, then the mousclick stream may be a single datasource.

Both UDP and TCP ride on top of IP (I have never seen Winsock, but their IP has to work similar to the internets IP) I tried to remain child-like, all I acheived was childish.
 
If you are doing something that can afford to drop packets, but needs to transmit quickly, then you are looking for UDP. If reliability is a factor, then you need TCP. Many of the newer protocols, like VoIP, use a combination of the two. They exchange control data over TCP, and stream data as UDP. You get the best of both worlds.

If you are interested in understanding a little more about the benifits of TCP vice UDP, look up RTSP, RTP, SIP and H.323. There is a great deal of information out there that explains why "real-time" applications really need UDP, and why they choose to back that up with TCP for the control channel.
pansophic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top