I am working on a system that requires high speed, low latency / jitter communications and is written in C #. We saw that there is a new mechanism for improving performance using sockets called Windows Registered IO http://www.serverframework.com/asynchronousevents/2011/10/windows-8-registered-io-networking-extensions.html
... But at the moment it is not available for C # ... and this, of course, shows the best performance based on testing in C ++.
In any case, I already wrote the Managed C ++ / CLI part for creating the DLL, and it seems to work fine with C # and significantly improved numbers.
But I am wondering if I can save a copy of the send buffer ...
Currently, the C ++ shell looks like this:
bool ManagedSendData( array<byte> ^ buf, ULONG bufLen )
{
pin_ptr<Byte> p = &buf[0];
unsigned char * cp = p;
return _RIObs->SendData( cp, bufLen );
}
Where _RIObsis an unmanaged C ++ object that implements the functionality of registered I / O. In this function, it copies the data to the buffer that was registered at startup with RIORegisterBuffer(), and then calls RIOSend()to notify the OS of the availability of data to send.
, : Managed ++ GCHandle::Alloc() , , RIORegisterBuffer() , , ++ ? , , , , , . , , .
, , , , .