Recently used C++ to write a modbus tcp master application.
but there is a problem to ask: If I have a layer of application A, B, C, D four (or more) used to request modbus tcp slaver data.
when I call send() , How to control the sending interval of the message, I now use the sleep(), but the feeling is stupid! If I set sleep (100), then I received the D message request data will be 300MS, if the message more, this time will be longer, simply can not hide the real-time data read.
That in this question and answer tcp communication, how to control the message to send continuously?
What I have tried:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////