UDP and File Transfer

  • Thread starter Thread starter Landley
  • Start date Start date
L

Landley

Dear Fellow Coders,

I am attempting to send files using UDP. I had no problem sending small
files, but when the files were over a certain size an exception was thrown.
It was moaning about the packet size.

I have since tried to break the file into 16k chunks and send them in
sequence. At the receiving end, I have another version of the same
application sending an acknowledgement when it has finished receiving. This
seems to work for the first 5-10meg, then it appears to send or receive
anything.

Does anyone have an example in VB.NET or C# on how to send large files via
UDP?

L.
 
Why are you using UDP instead of TCP? TCP is much more reliable
especially in your application. UDP has no handshakes and is really
only useful for small bits of data. You might get away with using both,
similiar to how Real Audio streams work, using TCP for initiating a
connection and then streaming bits over UDP.

Hope that helps.

Patrick Altman
<><
 
I was using UDP as the initial specification required no handshakes and
messages and files were going to be pushed.

Things have changed now, so I will be using TCP instead. Do you have an
example or know where I can get an example of file transfer? Also, are
there limitations, or can I just simple write the entire byte array of the
file to the server stream?

L.
 
Dear Fellow Coders,

I am attempting to send files using UDP. I had no problem sending small
files, but when the files were over a certain size an exception was thrown.
It was moaning about the packet size.

I have since tried to break the file into 16k chunks and send them in
sequence. At the receiving end, I have another version of the same
application sending an acknowledgement when it has finished receiving. This
seems to work for the first 5-10meg, then it appears to send or receive
anything.

Does anyone have an example in VB.NET or C# on how to send large files via
UDP?

L.
Hey man, do you still have the source code for transmitting small files via UDP( C#). I really need that if you can provide. Pretty please :)
 
Back
Top