ipc

Recommended way of sharing an object between C# processes

你离开我真会死。 提交于 2019-12-05 13:34:12
I have read numerous different things about IPC between 2 C# applications and their pros and cons, but don't feel like I have reached a satisfactory answer yet for my use case. I have an object that already exists that will change frequently (I am trying to attach my tool to a game and use it to debug elements created with the tool). As a result, I don't beleive serialisation is appropriate as I would essentially be serialising/de-serialsing the object 60 times a second for no good reason. As a result, piping is not possible (or am I missing something here?). As the game is running in Unity, I

IPC: Connect for each request or keep socket open?

大憨熊 提交于 2019-12-05 13:30:32
I am planning to use sockets (local TCP) to communicate between two processes (running locally). One process will act as a server, but both processes send messages to each other asynchronously. Should I keep the socket connection open for the lifetime of the processes, or re-connect for each request? Are there any problems that may occur if I keep a local socket open? Keep the socket open. Its the simpler option and you don't incur in the overhead of opening a new socket (from the client point of view) or accepting a new client (from server point of view). If it's just one client, then you

Pipe vs msg queue

佐手、 提交于 2019-12-05 10:51:41
问题 What is the difference between message queues and a pipe in Linux? 回答1: Off the top of my head and assuming you talk about posix message queues (not the SysV ones): Pipes aren't limited in size, message queues are. Pipes can be integrated in systems using file descriptors, message queues have their own set of functions, though linux supports select() , poll() , epoll() and friends on the mqd_t . Pipes, once closed, require some amount of cooperation on both sides to reestablish them, message

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

戏子无情 提交于 2019-12-05 08:58:44
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 <sys/stat.h> #include <stdio.h> #include <string.h> using namespace std; main() { int fd; char * myfifo =

Inter-Page communication in WWW?

橙三吉。 提交于 2019-12-05 07:21:21
问题 Is there a way to make client-side interprocess communication between multiple web pages in javascript? Ideally I'd like to accomplish this without any complex server status updating, pinging, etc. and make it work solely on the client. If I could make this cross-browser as well, I would be in heaven haha. Any ideas? Thanks! 回答1: There are many ways of doing inter-window communication. They are Window.postMessage, Local Storage, WebRTC, and nowadays Shared Web Workers. Each of these has their

boost removing managed_shared_memory when process is attached

不想你离开。 提交于 2019-12-05 07:10:26
问题 I have 2 processes, process 1 creates a boost managed_shared_memory segment and process 2 opens this segment. Process 1 is then restarted and the start of process 1 has the following, struct vshm_remove { vshm_remove() { boost::interprocess::shared_memory_object::remove("VMySharedMemory"); } ~vshm_remove() { boost::interprocess::shared_memory_object::remove("VMySharedMemory"); } } vremover; I understand that when process 1 starts or ends the remove method will be called on my shared memory

communication between two flex apps

最后都变了- 提交于 2019-12-05 07:02:09
I have 2 flex apps on the same page. I want them to be able to call each other's public functions. I am thinking of using either externalInterface calls or FaBridge to do so. Is there a better way to do it? David Verhasselt The best way to go is to use LocalConnection . It allows you to call methods from a separate SWF without having to go through Javascript or a server. Tip: if you're going to be sending arguments that are greater than about 20KB in size, you will want to split them up in two or more calls. In my experience LocalConnection calls have a limit of around that size for data. 来源:

IPC::Open3 Fails Running Under Apache

强颜欢笑 提交于 2019-12-05 06:54:17
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 runs under Apache. Previously, the code constructed a horribly complex command, which included a here

Linux IPC - Multiple writers, single reader

▼魔方 西西 提交于 2019-12-05 06:30:31
问题 I have never written any IPC C++ on Linux before. My problem is that I will have multiple clients (writers), and a single server (reader). All of these will be on the same machine. The writers will deliver chunks of data (a string/struct) to the reader. The reader will then read them in FIFO and do something with them. The types of IPC on Linux are either Pipes or Sockets/Message Queues as far as I can tell. I was just wondering if someone could recommend me a path to go down. I'm leaning

Trouble reading from Memory Mapped File

Deadly 提交于 2019-12-05 06:15:01
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 = MemoryMappedFile.CreateOrOpen("AuditStream", 1024 * 1024); private Mutex mutex = new Mutex(false,