inter-process-communicat

Bi-directional inter-process communication using two pipes

为君一笑 提交于 2021-01-28 08:44:22
问题 I am trying to write code that forks a subprocess and communicates with it using pipes. I am using two pipes - one for writing to, and the other for reading from the standard streams of the subprocess. Here's what I have so far: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> #include <string.h> void read_move(int fd) { FILE *stream = fdopen(fd, "r"); char c; setvbuf(stream, NULL, _IONBF, BUFSIZ); while ((c = fgetc(stream)) != EOF) { putchar(c); } fclose(stream)

powershell multi-runspace event passing

怎甘沉沦 提交于 2020-01-22 21:29:09
问题 I've been searching for a way to pass events between different runspaces and yet have not found any. The following snipped creates a background runspace, which shows a small window with only one button. OnClick it shall post an event that the main runspace should receive: $Global:x = [Hashtable]::Synchronized(@{}) $x.Host = $Host $Global:rs = [RunspaceFactory]::CreateRunspace() $rs.ApartmentState,$rs.ThreadOptions = "STA","ReUseThread" $rs.Open() $rs.SessionStateProxy.SetVariable("x",$x)

Android IPC Remote service call display Error

一个人想着一个人 提交于 2020-01-11 12:15:00
问题 I want to make one demo application regarding the IPC communication .(Communication between Service). I am using AIDL for that . I found most of tutorial the RemoteService and Client are in same package . I actually do it separately ,While passing the object I am using Parcelable Method and facing Error ... It said like The RemoteService Signature unable to find your class.. I displayed my Logcat Below also : If you have any solution please guide me ...or any interdependent server client

basics to create a MML console in Python

坚强是说给别人听的谎言 提交于 2020-01-06 05:33:08
问题 I am looking to have a MML (man machine language) console written in Python as the only entry point to control and monitor a back-end process. Basically will be able to: attach to an existing back-end process if back-end process is not running, still open console and be able to spawn back-end process (by introducing the correct command) auto-complete permitted commands be able to change back-end process behavior based on the introduced commands What would be the best way to achieve this? How

Communicate data between C and Python apps running continuously

…衆ロ難τιáo~ 提交于 2020-01-06 02:36:10
问题 Is there a way to pass data between continuously running C program and continuously running Python program? It is crucial that C program starts first. So far I have (for C side): void run_cmd(char *cmd[]) { int parentID = getpid(); char str[1*sizeof(double)]; sprintf(str, "%d", parentID); char* name_with_extension; name_with_extension = malloc(2+strlen(cmd[1])+1*sizeof(int)+1); strcat(name_with_extension, cmd[1]); strcat(name_with_extension, " "); strcat(name_with_extension, str); pid_t pid;

How can I send a message to a specific process by process id rather than by window handle?

五迷三道 提交于 2020-01-01 00:48:25
问题 To work around the limitations of GenerateConsoleCtrlEvent, I have to create an intermediate "middle-man" process to handle launching some console applications. The process's main purpose is to call GenerateConsoleCtrlEvent on itself, causing itself and all child process to close cleanly in response to a ctrl+break signal (rather than using Process.Kill). This need arises from the fact that GenerateConsoelCtrlEvent basically has no effect unless the process group id is zero, which means it is

Inter-Process communication options

别说谁变了你拦得住时间么 提交于 2019-12-30 18:30:49
问题 I need to subscribe inside one app for the event exposed by another app. I noticed that many people consider the using of WCF Named Pipes as the best practice. Am I right that if I choose WCF Named Pipes I'll have to use IIS? And by the way, what options do I have in general? 回答1: Named pipes are one of the fastest way to do IPC (inter-process communication) on the same machine. The have existed for a long while (was NT4 the first OS?) and not specific for WCF. I would however not use WCF

OS-independent Inter-program communication between Python and C

纵然是瞬间 提交于 2019-12-30 06:35:32
问题 I have very little idea what I'm doing here, I've never done anything like this before, but a friend and I are writing competing chess programs and they need to be able to communicate to each other. He'll be writing mainly in C, the bulk of mine will be in Python, and I can see a few options: Alternately write to a temp file, or successive temp files. As the communication won't be in any way bulky this could work, but seems like an ugly work-around to me, the programs will have to keep

Efficient Python to Python IPC [closed]

丶灬走出姿态 提交于 2019-12-29 11:34:08
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 months ago . What would be an inter-process communication (IPC) framework\technique with the following requirements: Transfer native Python objects between two Python processes Efficient in time and CPU (RAM efficiency irrelevant) Cross-platform Win\Linux Nice to have: works with PyPy UPDATE

How to persistently save PendingIntent provided by another application

浪尽此生 提交于 2019-12-23 08:50:07
问题 let's say I want to implement an app which exposes services to other apps (like Google Play Services..). potential apps would register to my special events associated with my services, and would be notified at the right time. I was thinking to implement this exactly like Google did with the Google Play services: thanks to Android Inter-Process Communication, other apps could bind to my app Service , and by that - pass to my app PendingIntent "callback" that I could execute for them at the