Reputation: 177
I have to implement zero copy method in a program in Qt C++,I read about it and got transferto() method.as described below: public void transferTo(long position, long count, WritableByteChannel target);
but i can't understand how it works.It is written that Internally, it depends on the underlying operating system's support for zero copy. So I tried to write a function but i didn't get the meaning of "position" and "channel" here.
Can anyone help me?
Upvotes: 1
Views: 584
Reputation: 40512
There is no cross-platform way to do zero copy in C++, and there is no zero-copy API in Qt. You can implement it for your target OS using provided API:
Linux supports zero copy through system calls such as sys/socket.h's sendfile, sendfile64, and splice. Windows supports zero copy through the TransmitFile API.
Upvotes: 4