modelica-3rdparty / Modelica_DeviceDrivers

Free library for interfacing hardware drivers to Modelica models. There is support for joysticks, keyboards, UDP, TCP/IP, LCM, MQTT, shared memory, AD/DA converters, serial port and other devices.
BSD 3-Clause "New" or "Revised" License
77 stars 31 forks source link

TCP/IP server support #295

Closed bernhard-thiele closed 4 years ago

bernhard-thiele commented 5 years ago

We already have TCP/IP client support (see #78), but no TCP/IP server support, yet.

I've now implemented TCP/IP server support (currently only for Windows). An interesting question is how to support that multiple clients can connect to the server using blocks for graphical components-based modeling. I experimented with a solution based on component arrays of the send and receive facilities and a single inner configuration object (tcpipserverconfig).

grafik

This is still a static approach, the maximum number of allowed clients needs to be given as a parameter and determines the array dimension for the send and receive blocks.

Actually, I think in the context of MDD the most probable use case is to allow only a single client. Supporting several clients is a bit cumbersome, but it is possible with this approach if needed.