TCP server using Add Ons

Hey everyone,
I´m new to VC and Python, so excuse me please if my question seems easy:
I want to program an Add On for VC to start a TCP server and send informations about the material flow to an external client.
I am not shure jet, if I want to use Python or C#. I tryed to start a seperate thread in C# and that works fine.
Is the same possible in Python? I read in an other Post, that VC uses something similar to stackless Python, but the regular commands don´t seem to work. Whenever I try to start a seperate thread VC either crashes or dose nothing.
Can someone please tell me, if it is possible to use python for this, and if yes, how.
Thanks a lot!

Threading is not supported in Python, and the stackless Python tasklets can’t be used either in VC.
For such applications that require parallelism, you basically have to use the .NET API.

Note that the .NET API of VC is not thread safe either, so while you can do request receiving and sending in other threads, you must access the VC .NET API only from the main thread. This can be done with e.g. the Dispatcher class or by scheduling callbacks in simulation time using ISimulation.ScheduleCallback(…).

1 Like

VC plugin should be another client.
These 2 clients write messages to server and read messages from server.