-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Related to: #95
I've got a modbus tcp/rtu relay, similar to #111 but even with that pull, the same problem exists.
The only method for receiving from a tcp socket is modbus_receive
, which, for indications, will block indefinitely. Once a single byte has been received on the socket, it will correctly timeout if a full frame isn't received. I'm using libevent2, and I can set a watermark so that I only get the event when backend->header_length
bytes have been received, so I'd like to be able to have some method of getting into the "middle" of modbus_receive. The problem with accept and modbus_receive is that there's no way out once you've called it. While the existing system works fine for real clients, a single user telneting to the listening port and not sending any data simply blocks the server.
I can't (yet) see any way around this without modifying libmodbus.