/// <summary> /// #TODO remove, this is not required. /// </summary> /// <param name="msg"></param> private void TerminateReaderThreadRequestMessageCallback(MlosProxy.TerminateReaderThreadRequestMessage msg) { // Terminate the channel. // MlosProxy.ChannelSynchronization controlChannelSync = mlosContext.GlobalMemoryRegion.ControlChannelSynchronization; controlChannelSync.TerminateChannel.Store(true); }
/// <summary> /// Constructor. /// </summary> /// <param name="buffer"></param> /// <param name="size"></param> /// <param name="sync"></param> public SharedChannel(IntPtr buffer, uint size, MlosProxy.ChannelSynchronization sync) { Sync = sync; unsafe { // Buffset size requirements: // - Buffer size must be aligned to sizeof(uint32_t). // - To handle position (uint32_t) overflow, // Size of the buffer must satisfy the following condition: // uint32_t.max +1 % Buffer.Size == 0. // Buffer = buffer; Size = size; margin = Size - (uint)sizeof(FrameHeader); } }
/// <summary> /// Constructor. /// </summary> /// <param name="sharedMemoryMapView"></param> /// <param name="sync"></param> public SharedChannel(SharedMemoryMapView sharedMemoryMapView, MlosProxy.ChannelSynchronization sync) : this(sharedMemoryMapView.Buffer, (uint)sharedMemoryMapView.MemSize, sync) { }