UDP and File Transfer

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.
 
P

Patrick Altman

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
<><
 
L

Landley

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.
 
Joined
May 11, 2013
Messages
1
Reaction score
0
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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top