ipc

How do I get a System.Windows.Form instance from its Win32 handle?

帅比萌擦擦* 提交于 2019-12-07 06:02:50
问题 The following code implements a simple singleton that ensures only 1 instance of my application can be run. However, if another instance is started, I need to be able to grab that instance's command-line arguments, pass them to the initial instance, then terminate the second instance. The issue comes in when I'm attempting to get hold of the first instance of the application. Once I've found the handle of that instance's main form, I pass it to the Control.FromHandle() method, expecting to

How can I handle IPC between C and Python?

て烟熏妆下的殇ゞ 提交于 2019-12-07 04:49:42
问题 I have a an application with two processes, one in C and one in Python. The C process is where all the heavy lifting is done, while the Python process handles the user interface. The C program writes to a large-ish buffer 4 times per second, and the Python process reads this data. To this point the communication to the Python process has been done by AMQP. I would much rather setup some for of memory sharing between the two processes to reduce overhead and increase performance. What are my

IPC: Using of named pipes in c++ between two programs

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 04:48:36
问题 I'm trying to realise a IPC between two different programs running on the same machine (in my case its a CentOS7). To have just a kind of loose coupling I decided to use a named pipe for the IPC. Therefore I'm was playing with the following example and ran into different problems. Creating and writing into the pipe: #include <sys/types.h> #include <sys/select.h> #include <errno.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <sys/types.h> #include

Which Java RMI/RPC/IPC technology should I use?

人走茶凉 提交于 2019-12-07 03:07:59
问题 I'm developing a Java application that consists of a server and a client (possibly multiple clients in future) which may run on different hosts. For communication between these two I currently use a custom protocol which consists of JSON messages that are sent over network sockets and that are converted back to Java Bean objects on both sides. However the more complex the application gets I notice that this method doesn't meet my standards and is too complex. I'm looking for a well

IPC::Open3 Fails Running Under Apache

ぃ、小莉子 提交于 2019-12-07 02:56:39
问题 I have a module that uses IPC::Open3 (or IPC::Open2, both exhibit this problem) to call an external binary (bogofilter in this case) and feed it some input via the child-input filehandle, then reads the result from the child-output handle. The code works fine when run in most environments. However, the main use of this module is in a web service that runs under Apache 2.2.6. And under that environment, I get the error: Cannot fdopen STDOUT: Invalid argument This only happens when the code

Trouble reading from Memory Mapped File

时光怂恿深爱的人放手 提交于 2019-12-07 02:37:52
问题 I am trying to implement a Memory Mapped File within my application (specifically a Windows Service), and then use a C# form to read from MMF the service writes to. Unfortunately i cannot seem to get the form to read anything from the MMF, more importantly it seems that the form never finds the MMF created by the Service. Below are code snippets that outline what im doing, can anyone see what I am doing wrong or be able to point me in a better direction? Service : private MemoryMappedFile mmf

Why do I get IPC delays on 20% busy machine

一曲冷凌霜 提交于 2019-12-06 21:34:24
I am getting delays on IPC on a single machine that has 10 cores and is running 47 instances of my ClientApp which are all communicating with the MasterApp. I appear to get severe latency on occasion. Here is part of my log. The DateTime on the left is the log DateTime(a high perf logger). The DateTimes within the [] are the times the message was sent from the MasterApp. Each message terminates with an @. So the first message is only 1ms behind, but the last is 71ms behind. Any ideas what might cause this and what I might do to get rid of the latency 20141030T120401.015 [--------*MD|USD/JPY

进程间通信 IPC interprocess communication

非 Y 不嫁゛ 提交于 2019-12-06 20:09:55
1,管道,FIFO 2, 信号 3,消息队列 4,共享类存 5.文件映射 6.socket ( 1 )管道(Pipe):管道可用于具有亲缘关系进程间的通信,允许一个进程和另一个与它有共同祖先的进程之间进行通信。   ( 2 )命名管道(named pipe):命名管道克服了管道没有名字的限制,因此,除具有管道所具有的功能外,它还允许无亲缘关系进程间的通信。命名管道在文件系统中有对应的文件名。命名管道通过命令mkfifo或系统调用mkfifo来创建。   ( 3 )信号(Signal):信号是比较复杂的通信方式,用于通知接受进程有某种事件发生,除了用于进程间通信外,进程还可以发送信号给进程本身;linux除了支持Unix早期信号语义函数sigal外,还支持语义符合Posix.1标准的信号函数sigaction(实际上,该函数是基于BSD的,BSD为了实现可靠信号机制,又能够统一对外接口,用sigaction函数重新实现了signal函数)。   ( 4 )消息(Message)队列:消息队列是消息的链接表,包括Posix消息队列system V消息队列。有足够权限的进程可以向队列中添加消息,被赋予读权限的进程则可以读走队列中的消息。消息队列克服了信号承载信息量少,管道只能承载无格式字节流以及缓冲区大小受限等缺   ( 5 )共享内存:使得多个进程可以访问同一块内存空间

IPC研究(1) -- signals

断了今生、忘了曾经 提交于 2019-12-06 19:53:34
==================================================================== IPC ---- Signals Question: Why is it unsafe to call printf() in a signal handler? A: A signal handling fucntion could be interrupted in the middle and called again by something eles. So a signal handling function is not just recurisve, but also re-entrant. This means, any system calls that are not re-entrant but are called inside a signal handler are considered unsafe. For system calls that are safe to call inside a signal handler, refer to page 524 in Book "Linux Programming". Related system calls: signal (deprecated) kill

Zuul not forwarding requests to other micro-services

梦想与她 提交于 2019-12-06 15:35:44
I am using spring boot micro-services. I have configured eureka, zuul proxy and another microservice(account). If I am calling from account directly it is working fine. account and zuul server both showing on eureka. When I try to hit using zuul proxy it is getting status code 200OK but not getting any result Below is my configuration for zuul Zuul.yml server: port: 8076 eureka: client: registerWithEureka: true fetchRegistry: true serviceUrl: defaultZone: http://localhost:8078/eureka/ instance: hostname: localhost health-check-url-path: /actuator/health status-page-url-path: /actuator/info