Full asyncronize communication system
Currently, Modbus.Net using await after sending messages. But this is a bug in fact. Problem is caused by error packages or passive messages that will caused message shifting.
So it is required to seperate send and receive thread.
Introducing Controller, a message sending control interface.
- CanSend. Some boardcasting packages acquire lock to block messages from other devices, especially in multi-master tropy system.
- Send. Send messages, and there is no receive in controller when send.
- Receive thread. Open a new thread to receive messages.
- Receive dispatching. Dispatch message to a message in send list or new in passive return list, and return it to connector, await in connector will be remained.
- Passive message event. Directly trig message to event when server send a message to client.
Progress Update : tcp step 1 complete serial step 1 coding complete, testing
Serial port is still untested.
Serial port tested but contains bugs. packet bytes should be thrown one by one when CRC check error happens.
Critial design issue: CRC or LRC check must be implenented in Controller layer. Will be fixed in next commit.
Commited, this enhancement has been completed(not tested for all protocols). Issue will be closed.