can anyone tell me what this does and how it works? I heard you can use it to send files over computers, but I have no clue at all. :confused:
Printable View
can anyone tell me what this does and how it works? I heard you can use it to send files over computers, but I have no clue at all. :confused:
anyone?
* Stack -> Push file
* Send -> Stack
On stack message
* Save received stack to file, position 0, size StackSize( "Lacewing" )
Make sure to check "automatically clear stack after sending" in the properties.
if your file is under 1/2 a kb that should work
okay Ricky, then how would I do it to send a file bigger than 1/2 kb?
You send it in sections of 512 bytes (or less) at a time. Check out my old file sender MFA (just convert it from OINC with the Lacewing patcher) and you should get an idea. ;)
Heh, I made a UDP file sharer which pwns TCP by a mile or so :D
Ricky, don't you want guaranteed packets with a file sender though? I would hate to be missing a few chunks of the final final.
I used to play a turn-based game which used UDP to transfer the game's save between players. Suffice to say it rarely ever worked, one dropped packet and the save was either too small (and the game hung) or corrupt (and the game crashed).
Use TCP for file transfers, the overhead of having to check for dropped, truncated or corrupted packets yourself with UDP makes it less efficient than just using TCP.
Or.. Send a file hash first so you can check you recieved the whole file via udp if it's not matching the hash after the stack has completed sending. Resend via UDP.
Personally I'd send using TCP.
The filesharer (Global File Transfer) uses an AI system to make sure all the packets are sent correctly. Consequently it doesn't have to send the whole file again, just a small part that was missed. :D
The AI ensures the file is sent faster than TCP and has just as much accuracy (100%).
In other words, you tag every packet with a checksum and a packet number, and resend if one is missed or corrupt? The same as TCP does?
I think you'll find that no matter what, doing reliability at the network layer (TCP) instead of the application layer will be faster.
Feel free to prove me wrong with some benchmarks.
UDP packets do contain a checksum; it guaranteed the data won't be corrupted, just not that it'll get there (or get there in the right order).
I agree that the network layer implementation of TCP is probably going to be a lot faster than anything you can create over UDP in MMF2. TCP does, however, have a rather huge header, so we'll see!
The other problem with UDP is that it doesn't automatically slow down to the slowest link in between the sender and receiver. Instead it just drops packets when the link is overloaded, and you have to retransmit them. If it's particularly bad, the sender could end up sending several times the size of the file in data before the receiver gets it all.
And that's on a reliable link.
EDIT: Just done some reading, UDP's checksumming is optional.
How can I send in parts? I can't find any exemple and if I want to send parts, I can't choose the file?
You have to read and push bytes, it takes some experience to do ;)
It's doesn't take experiance as much as it takes the ability to figure stuff out by looking at it. I made my first version of the working file sender without any previous tests, and I'd never had any previous experiance.
So far 3 different file senders have been made; Mine the first, Rick123 (SortaCore)'s the second, and Stephen1980's the third. (Sorry if I am forgetting one)
I will post the latest source (in Lacewing) of my file sender if you want. ;) Though I haven't optimised it yet, and I will be doing that once every other issue is fixed.
I recieved help and it's working now quite fine :)
LB I didn't mean experience with the Lacewing object, I meant experience with MMF2 in general ;)
And I'd like to note that your first file sender's code was dreadfully awful, no offense
Yes, it is much better now, and I am planning on optimising it to be much faster. ;)