How to send big data over network!?

Hey,

after more than a week and 30 hours of work, i have really no idea. How to solve this ****** problem!
I need to send big data (10mb and more).

This “hack” uNET - Send big amount of data over network (How to split send byte[]?) - Questions & Answers - Unity Discussions is not a solution beacause i dont want to use those server/ client calls.

I tried this solution:

and extend it to sending many NetworkMessages and it should collect them and put them together then. But now the buffer of 64K bytes is a problem.

One other thing:
If you send a message of size 2000 and then a message with size 500, Unity will send TWO times a message with a size of 2500…

In the attachment you can see it. (I didnt write the collecting, due to the sending isnt working as expected).

Please tell me how to send those big data…

2804080–203628–byte_sender_022db4.zip (51.5 KB)

Please send a ReliableFragmented QOS to make it possible to send larger data chunks and send your data in chunks. There is no good way of sending a 1MB file in a single packet. Almost all routers will reject it and you need huge buffers for processing which opens you up for DOS attacks.
You should send such data in chunks and with chunk number and if you do this correctly, it will work perfectly.

Actually all file streaming APIs and streaming protocols like TCP do this.

Can you tell my how i should do this?

I already send the file splitted in many NetworkMessages but then the buffer cannot collect them …

It seems to be working with Fragmented Channel + SendBytes but how can i get an event if you receive something?
A static class?