When it comes to network library, wouldn't it only need a pointer to data that you have in your application? Copying it over to librarys variable space is time consuming, but propably much much less time than it takes for it to move over network.
Much of the work regarding TCP buffers is done by the operating system. You don't necessarily need to do an extra layer yourself to encapsulate packets. TCP protocol guarantees that everything arrives in its destination in same order as you send, without loss.
If it works, it's ok. The less the data is moved around the better.
Bookmarks