Jump to content

Recommended Posts

Posted

Hi there,

I'm trying to decided whether I should use TCP or UDP for my current project, and I would like to hear some opinions.

My Situation

I have 1 computer that will send out very small amounts of data extremely fast to several other computers (10-20).

Example data sent: "123/123"

So basically I will be sending data like the above to 10-20 computers, at an extremely fast pace. However it does not matter how fast it receives the data, I want to focus on the speed of sending it, I want to have a fast return on my UDP/TCP Send function.

Now, I understand that TCP is the most reliable, and UDP is connectionless but could be glitchy and receive duplicate packets/packets in wrong order/etc.

Here's a few questions I'm not 100% clear on..

1. Is it possible to be sending this small amount of data to so many computers at a very fast pace ?

2. Do you need seperate TCP streams when sending out data? ..

like for example, will I need to create a For loop for each connection and call TCPSend ? Is this the same with UDP?

You see, my vision is to have this data sent out with 1 line of code (so it returns quickly), and still be able to have several clients receive the data.

Sorry if I'm not giving enough information/being clear enough.. I need a nap!

Thanks alot,

Kurt

Awaiting Diablo III..

Posted (edited)

Since TCP is "connection oriented," you need a new connection to each destination. With UDP, a "connectionless" protocol, you can multicast (like a broadcast but more specific) packets to your destinations.

Edit: heh, forgot to mention, I'd suggest UDP for this kind of solution.

Edited by Richard Robertson

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...