Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow TCP server and client blocks in the same model #325

Open
bernhard-thiele opened this issue Oct 21, 2020 · 1 comment
Open

Allow TCP server and client blocks in the same model #325

bernhard-thiele opened this issue Oct 21, 2020 · 1 comment
Milestone

Comments

@bernhard-thiele
Copy link
Collaborator

bernhard-thiele commented Oct 21, 2020

At the moment it is a bit cumbersome to get started with the TCP/IP blocks since it is not possible to have them in the same example model as is possible for all other communication blocks.

A first experiment has shown following issues:

  1. The client block needs to connect to a running server during initialization and blocks until the connection is established. It needs to be ensured that the server is started before the client tries to connect, otherwise simulation progress is dead locked.

  2. The intertwined server and client receive/send results in a infinite blocking even if server is started before the client.

Issue 1. can be ensured by suitable logic within Modelica, but it seems that 2. needs changes in the C code. One option is to run the server read and write in a detached thread. Maybe it is also possible to avoid blocking by supporting non-blocking I/O in both, client and server.

@bernhard-thiele bernhard-thiele added this to the v2.1.0 milestone Oct 21, 2020
@bernhard-thiele
Copy link
Collaborator Author

Note: Also handle broken pipe errors in the server code (client disconnects) as non fatal and recover gracefully

bernhard-thiele added a commit to bernhard-thiele/Modelica_DeviceDrivers that referenced this issue Jun 1, 2021
bernhard-thiele added a commit to bernhard-thiele/Modelica_DeviceDrivers that referenced this issue Jun 23, 2021
@bernhard-thiele bernhard-thiele modified the milestones: v2.1.0, v2.2.0 Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant