I have a windows client for a data monitoring application written in C#. And I have a python script compiled with Pyinstaller that keeps sending data to the client every few seconds.
When I manually run the python application ( by double-clicking it ), it runs perfectly ( keeps sending the data continuously ), however, when I start the application in C#, it stops sending the data after 2-3 minutes.
I read about ironpython
but thought of doing it the old way as the script had a few dependencies.
This is the code I'm using to spawn the python process:
Process process = new Process();
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.FileName = "relative-path-to-exe";
process.Start();
I've even tried to set the process priority to High/Realtime
using the following code, but it didn't help:
process.PriorityClass = ProcessPriorityClass.RealTime;
Any idea what might be causing this issue ?