Most of my research was obtained working on this script Web Server
as a result most of what i have learned since i started playing with sockets was placed in it as well.
What i have told you about trying to keep the socket buffer as full as possible and send the right packet size is the result of that research.
Another tip is to keep the cpu usage as low as possible.
I haven't been working much on it lately but my latest test during the 7.16 and 7.16 benchmark shown improvements on speed.
My private version of this script uses something like congestion avoidance algorithm to find in real-time the best size to optimize speed transfer.
You can also see for your self using that addon and converting line 1039 (if i am not mistaken) to a global var, then change the values until you get maximum performance.
I can tell you it is by default optimized for internet transfers.
You can try to find the optimal lan value, the one that allows transfers up to 4 MB/s (and yes, it is megabytes/second).