2

I am trying to implement zero copy mechanism i.e. a contrary function to the TransmitFile() API.

But I don't know how to register buffers in kernel. Below are the details what I want to do to implement zero copy:

  1. We will receive a large data from the server in our client buffer, I have a doubt here also that weather data will come to socket buffer(client's) or first it will come into NIC buffer, please clear this doubt also.

  2. Now from socket buffer I want to copy the data directly to the kernel buffer and then to file in the disc without going for read and write system calls i.e without switching contexts.

  3. Data has to be moved directly to kernel buffer within kernel space only.

Is there any API or some method to achieve this? Any other suggestions?

Sockets are on TCP/IP Connection.

Satya Kumar
  • 179
  • 1
  • 4
  • 19
  • 1
    Which kernel are you talking about? What is the "TransmitFile() API"? Some more details would be nice. – Lstor Jul 02 '13 at 07:47
  • 1
    Either you're attributing third-party stuff to C++ itself, or you're just forgetting that we're not all working on the same project as you. Open your mind! Tell us what you're talking about. – Lightness Races in Orbit Jul 02 '13 at 07:51
  • what is your hardware ? – lucasg Jul 02 '13 at 07:51
  • well I am using windows 7 whichever kernel it is using i don't know.for Transmit File() API refer this link:http://msdn.microsoft.com/en-us/library/windows/desktop/ms740565(v=vs.85).aspx – Satya Kumar Jul 02 '13 at 07:51
  • @georgesl:what you mean by hardware here? i saw in my comp properties it is: ACPI x86-based PC – Satya Kumar Jul 02 '13 at 07:58
  • @LightnessRacesinOrbit: i am working on VC2010,C++,OS:Windows7 waht else do you want to know? – Satya Kumar Jul 02 '13 at 08:09
  • @SatyaKumar : zero-copy buffers are really low-level libraries (it's middleware) which should be implemented in x86 standard PC. Therefore I assumed you were working on more "exotic" proc (microP, FPGA, etc.) – lucasg Jul 02 '13 at 08:16
  • @LightnessRacesinOrbit: If you don't know the answer then no need to give suggestions.Other people know what I'm talking about. – Satya Kumar Jul 03 '13 at 05:09
  • 4
    @Satya: Don't be cheeky; you're here for free help. Certainly the wealth of answers posted on this question over the past 23 hours (read: _none_) indicates that "other people know what [you're] talking about". – Lightness Races in Orbit Jul 03 '13 at 07:37
  • @LightnessRacesinOrbit He answered in a bad way, but the other user certainly didn't know the context of the question, which for me, being a C++ Windows programmer, I quickly understood what the author meant, that being said, avoid comments from the same level of the user with ironies or that could generate intrigue. Pay attention to the rules! – Lucas Paixão Mar 07 '23 at 21:35

1 Answers1

1

There is not any API as such for receiving unfortunately.but you can try ZwWrite().