Я использую .net 4.6 EasyModbus (я пробовал также nmodbus4 с той же ошибкой) клиентская библиотека tcp для подключения к серверу TCP Modbus (устройство hw). У меня нет контроля над устройством HW, выполняющим роль моего tcp-сервера. Я запускаю свою программу в Mono на Raspberry Pi 2 с распбианским натяжением.
Я получаю эту ошибку:
Exception System.IO.IOException: Unable to read data from the transport connection: Operation on non-blocking socket would block. ---> System.Net.Sockets.SocketException: Operation on non-blocking socket would block
at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) [0x00016] in <f74b9f2fea8d47a7922726922726600e468191>:0
at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x0009b] in <f74b9f2fea8d47a7922726600e468191>:0
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x000e2] in <f74b9f2fea8d47a7922726600e468191>:0
at EasyModbus.ModbusClient.ReadHoldingRegisters (System.Int32 startingAddress, System.Int32 quantity) [0x00579] in <a086c8acfd1f4a5d8715dc8f400211ae>:0
Подробная информация о моей настройке:
uname -a: 4.4.27-v7+ #917 SMP Tue Oct 25 16:00:29 BST 2016 armv7l GNU/Linux
.net framework 4.6
Mono JIT compiler version 5.18.1.0 (tarball Fri Mar 15 21:15:07 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: normal
Notifications: epoll
Architecture: armel,vfp+hard
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(600)
Suspend: preemptive
GC: sgen (concurrent by default)