Hi all,
I have an array that have 78840 items in it.
and every item has maximum 10 digits in it(like pt[78840]=1234567890)
I want to send this array to another computer.
What is a fast (fastest) way to send them (in about miliseconds)??
Please help me...
thanks.
Posted on 2006-04-28 14:40:44 by dsolarium
Depends on your upload speed

Using send() should use the maximum available. Therefore :
Size of Stuff to send / Max Speed = Time
Posted on 2006-04-28 15:17:16 by JimmyClif
Since it is 10digits, it cannot fit into 32bit integer type, so it has to be sent in 64bits. Lets work in bytes as it is easy to visualise.

8 * 78840 = 630720bytes
~616kbytes

So for it to be sent in milliseconds, your bandwidth must be gigantic. ;)

Posted on 2006-04-28 21:12:37 by roticv
Hm, "max 10 digits". It would be more useful if you state the maximum value an item can have (ie, does it fit into a 32bit integer, or do you need 64bit as roticv suggested). Also, are you storing the items as integers, or as strings?

The fastest way to send from one computer to another (without using specialized stuff) would be UDP - but if you need "resend data on failure", TCP might be better since often one ends up adding so much on top of UDP that you've basically re-implemented a mini-TCP.

On a 100mbit LAN that isn't too congested, with peak rates of 8MB/sec (realistic if your hardware Doesn't Suck (TM)), you should be able to send 13 packs of 616kb per second... with some connection overhead etc., that would probably translate to somewhere between 80-100ms per pack - but probably some more in real-life situations.

If you need to travel across the internet, good luck :P
Posted on 2006-04-29 03:24:13 by f0dder