I'm devising a protocol to be sent via TCP packets that can sometimes send large (video) files between iOS and OSX devices. I've got three questions:
1) What is the maximum size for each TCP packet for good performance? ie: Is it better to get close to 65535 and let TCP break the data up, or try to stay below a certain threshold. If the latter, what?
2) What is the lowest-overhead way of reading data buffers from a file and sending through the TCP socket? As is often the case in Cocoa, there are a number of ways: NSInputStream - NSFileHandle - POSIX file handle
3) What is the lowest-overhead way of appending the data received from the TCP socket to a file? We have: NSOutputStream - NSFileHandle - POSIX file handle
I'm using GCDAsyncSocket for the sockets.
Thanks!