We got multiple devices that communicate over different protocols (rs232, tcp, http, etc.) and we want be able to send requests from multiple interfaces (as well get responses from each device to multiple interfaces).
We are wondering how to properly manage the communication between interface clients and device clients. One solution is to make a server manager which will handle one connection to multiple interface clients and one connection to multiple modules. But, I'm not a fan of it due to multithreaded code that should be manage. Diagram:
So mine proposal is to make a manager which have got multiple servers, so each module and specified interface will be clients that communicate with concrete module server. Diagram:
Which one is better and why? In mine opinion the version with multiple servers will separate multithreaded logic for each module. On the other hand we will have multiple connections, but is it a thing to worry about it?
Thanks in advance.