浏览代码

speed up netstat on mac

/pyrception-integration
leopoldo-zugasti 3 年前
当前提交
1fded322
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 10
      com.unity.perception/Editor/Visualizer/VisualizerInstaller.cs

10
com.unity.perception/Editor/Visualizer/VisualizerInstaller.cs


}
Process[] after = null;
int maxAttempts = 5;
int maxAttempts = 20;
Thread.Sleep(1000);
Thread.Sleep(200);
after = Process.GetProcesses();
newVisualizerPID = GetNewProcessID(before, after, nameOfVisualizerProcess);
if(attempts == maxAttempts)

attempts = 0;
while(newPythonPID == -1)
{
Thread.Sleep(1000);
Thread.Sleep(200);
after = Process.GetProcesses();
newPythonPID = GetNewProcessID(before, after, "python");
if(attempts == maxAttempts)

attempts = 0;
while(newPort == -1)
{
Thread.Sleep(1000);
Thread.Sleep(200);
newPort = GetPortForPID(newPythonPID);
if(attempts == maxAttempts)
{

StartInfo.Arguments = "-a -n -o";
#elif UNITY_EDITOR_OSX
StartInfo.FileName = "netstat";
StartInfo.Arguments = "-v -a";
StartInfo.Arguments = "-n -v -a";
#endif
StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
StartInfo.UseShellExecute = false;

正在加载...
取消
保存