ipc

Windows - Wait on event and socket simulatenously

烂漫一生 提交于 2021-02-18 07:47:59
问题 I'm writing Win32-API C code that needs to wait for new TCP connections and on the other side can be closed at any time by any other process/thread. Therefore, I need to somehow WaitForSingleObject on the stop event and wait for connections using WSAAccept simultaneously. I tried WaitForMultipleObjects on both socket and handle but new connection won't trigger the function (also WaitForSingleObject on the socket won't be triggered on a new connection). Any idea? 回答1: You need to use

Access denied on WaitForSingleObject on an event created from managed code

假如想象 提交于 2021-02-16 19:36:10
问题 How do I create a named event object in C# so that I can wait on it in separate C++ process? My simplified C# code of process A: EventWaitHandle evt = new EventWaitHandle(false, EventResetMode.AutoReset, "eventName"); EventWaitHandle.SignalAndWait(evt , <other event>); And simplified C++ code of process B: HANDLE hEvt = OpenEvent( EVENT_MODIFY_STATE | SYNCHRONIZE, // access FALSE, // do not inherit handle TEXT("eventName") ); if (hEvt == NULL) { printf("CreateEvent failed (%d)\n",

IPC between C application and Python

 ̄綄美尐妖づ 提交于 2021-02-07 08:27:51
问题 So I am relatively new to IPC and I have a c program that collects data and a python program that analyses the data. I want to be able to: Call the python program as a subprocess of my main c program Pass a c struct containing the data to be processed to the python process Return an int value from the python process back to the c program I have been briefly looking at Pipes and FIFO, but so far cannot find any information to address this kind of problem, since as I understand it, a fork() for

IPC between C application and Python

余生长醉 提交于 2021-02-07 08:20:11
问题 So I am relatively new to IPC and I have a c program that collects data and a python program that analyses the data. I want to be able to: Call the python program as a subprocess of my main c program Pass a c struct containing the data to be processed to the python process Return an int value from the python process back to the c program I have been briefly looking at Pipes and FIFO, but so far cannot find any information to address this kind of problem, since as I understand it, a fork() for

How to share memory between linux program and windows program running through Wine (same computer)?

冷暖自知 提交于 2021-02-06 15:29:05
问题 Is there a way (and then how to) share memory between a linux program and a windows program running through wine ? Since it could be hard to understand why to do such a thing, I give you my situation : I've a proprietary program compiled only for windows, but this program has an open C plugin API. But, I'd like to make part of my code running on a native application (and use other libraries and other advantages of linux), and doing the IPC in a fast way 回答1: The purpose of Wine is to provide

How to share memory between linux program and windows program running through Wine (same computer)?

穿精又带淫゛_ 提交于 2021-02-06 15:28:37
问题 Is there a way (and then how to) share memory between a linux program and a windows program running through wine ? Since it could be hard to understand why to do such a thing, I give you my situation : I've a proprietary program compiled only for windows, but this program has an open C plugin API. But, I'd like to make part of my code running on a native application (and use other libraries and other advantages of linux), and doing the IPC in a fast way 回答1: The purpose of Wine is to provide

Manipulate DOM in Electron

﹥>﹥吖頭↗ 提交于 2021-02-06 14:00:22
问题 What is the best way to manipulate DOM within an electron app? I made some tutorials from docs using ipc and webcontents with no luck My app is so simple, I just want to use the web like a console and showing messages (render proc) comming from the results of several sync functions (main proc) I updated the question with real code. I'm going to put another code, more simple to see and more simple to test (I think), is real code and works (but not like I want) When I launch electron only

Manipulate DOM in Electron

﹥>﹥吖頭↗ 提交于 2021-02-06 13:59:45
问题 What is the best way to manipulate DOM within an electron app? I made some tutorials from docs using ipc and webcontents with no luck My app is so simple, I just want to use the web like a console and showing messages (render proc) comming from the results of several sync functions (main proc) I updated the question with real code. I'm going to put another code, more simple to see and more simple to test (I think), is real code and works (but not like I want) When I launch electron only

Calling python script from C#

浪子不回头ぞ 提交于 2021-02-06 13:32:37
问题 I have a C# code which helps to run python environment first and then it executes my python process. But the problem is it takes a lot of time to execute. Actually i just want to pass my values and execute single line of code in python script. But need to execute all python code every time. Is there a way to run python process out side and just run the single line when i want. I attached both C# code and python process with this C# Code public String Insert(float[] values) { // full path of

Calling python script from C#

徘徊边缘 提交于 2021-02-06 13:30:06
问题 I have a C# code which helps to run python environment first and then it executes my python process. But the problem is it takes a lot of time to execute. Actually i just want to pass my values and execute single line of code in python script. But need to execute all python code every time. Is there a way to run python process out side and just run the single line when i want. I attached both C# code and python process with this C# Code public String Insert(float[] values) { // full path of