public virtual void FireDataEvent(string ip, int port, long time, ReadOnlyMemory <byte> data, string ID, uint ipuint) { try { DataReadySyncEvent?.Invoke(ip, port, time, data, ID, ipuint);//Interlocked.CompareExchange(ref DataReadyEvent, null, null)?.Invoke(ip, port, time, data, ID, ipChunks); if (DataReadyAsyncEvent != null) { channelAsyncData.Writer.TryWrite(new EventItem { IP = ip, Port = port, Time = time, Data = data.Lease(), ID = ID, IpUInt = ipuint }); } } catch (Exception e) { logger.Warn(e, "Client exception while processing DataEvent"); } }
private void OnCommunicatorSyncData(string ip, int port, long time, ReadOnlyMemory <byte> data, string ID, uint ipuint) { // Same socket receive thread. Memory must be consumed in this method DataReadySyncEvent?.Invoke(ip, port, time, data, ID, ipuint); }