コード例 #1
0
 private Task ReceivedReadJob(Memory <byte> buffer)
 {
     if (_provider != null)
     {
         var data = S7ReadJobDatagram.TranslateFromMemory(buffer);
         Task.Run(() => HandleReadJobAsync(data).ConfigureAwait(false)); // here we do not have to wayt because the receive buffer is fully converted and is not needed anymore
     }
     return(Task.CompletedTask);
 }
コード例 #2
0
        private void ReceivedReadJob(Memory <byte> buffer)
        {
            var data = S7ReadJobDatagram.TranslateFromMemory(buffer);

            if (_readHandler.TryGetValue(data.Header.ProtocolDataUnitReference, out var cbh))
            {
                cbh.Event.Set(_defaultReadJobResult);
            }
            else
            {
                _logger.LogWarning("No read handler found for received read job reference {0}", data.Header.ProtocolDataUnitReference);
            }
        }