ipc

Running a JNA example with POSIX message queues

孤街醉人 提交于 2019-12-11 19:05:05
问题 I need to communicate a Java application and a C process via POSIX message queue, and I would like to do it using JNA. After some research, reading and your help, I started with a simple Java application which tries to create a message queue. /** Simple example of JNA interface mapping and usage. */ public class HelloJNAWorld { // This is the standard, stable way of mapping, which supports extensive // customization and mapping of Java to native types. public interface IPCLibrary extends

Passing Objects in IPC using Messenger in Android

北城余情 提交于 2019-12-11 17:51:40
问题 I am using Messenger instead of aidl in Android for IPC. I have a service with which clients can bind . How can i pass a custom object form service to a client using Messenger Mechanism for IPC so that client can use that object to invoke operations.I know we can send simple data types using Parcelable or databundle but what about custom objects 回答1: How can i pass a custom object form service to a client using Messenger Mechanism for IPC so that client can use that object to invoke

Choice of IPC method

别说谁变了你拦得住时间么 提交于 2019-12-11 17:40:59
问题 I have several mathematical dlls, some of them are for x64 platform, some - for x86. I also need to communicate with several COM interfaces (in particular, 64-bit versions of Matlab and STATISTICA). So to solve problem with mixed dlls i splitted my software into 3 independent programs - 2 of them are 32-bit and 1 - 64-bit. All programs have to communicate with each other and also connected to mutual SQL database. Moreover, it is possible, that one program will work on client computer and

dotnet core create named pipes without “CoreFxPipe_” in file name

旧街凉风 提交于 2019-12-11 17:33:44
问题 When creating named pipes using the NamedPipeClientStream or NamedPipeServerStream classes of dotnet core, the associated "pipe" (which appears to actually be a socket) has "CoreFxPipe_" added to the front of the file name automatically. Is there a non-hacky way to prevent this behavior? I would simply like the file name to be exactly the name I provide to the constructor. In the dotnet core documentation, it describes the following constructor: NamedPipeServerStream(String) Initializes a new

Best mechanism to implement an IPC Bus in .NET?

☆樱花仙子☆ 提交于 2019-12-11 16:02:12
问题 I have several apps that want to communicate LOCALLY via a data bus. Ideally: They talk and listen whenever they come online There will not be an "owner" of this communication method. No extra components to install (ie. Message Queues) It would be nice if there were no ports to require open What do you think is the best technology to do this? Is there a way to use WCF for a data bus? 回答1: Yes you can and I think should use WCF to do this. The Named Pipe Binding is awesome at on box

Calling SysV msgsnd from signal handler

老子叫甜甜 提交于 2019-12-11 15:56:19
问题 Is it safe to invoke msgsnd function from signal handler? Code for our services is not intended to every gracefully complete, so I don't have exit point, however I need to send message to another process when services is stopped, so I need to catch SIGTERM and perform msgsnd before calling exit(0). Is that safe? I looked into signal safety manual page and did not found msgsnd in the list. Should I consider this as unsafe function? What are the possible consequences? 回答1: No, it's not safe.

JAVA - make one program interact with another

时光毁灭记忆、已成空白 提交于 2019-12-11 14:37:43
问题 I'm trying to learn how to make different programs interact with each other, but finding information online on that has been impossible for me. I'm a self taught Flash/PHP programmer who has learned basic java recently. Let´s assume there is a game coded in Java, and I have access to its open source. If I wanted to make a Frames Per Second display for it, I could easily do that now with my current knowledge. I'd open Eclipse, examine the code and find where to properly place the FPS counter,

WebSocket over AF_UNIX socket

你离开我真会死。 提交于 2019-12-11 13:52:39
问题 Is it possible to use WebSocket over AF_UNIX sockets (Unix-domain sockets)? Is it technically possible, and if so, do any implementations (mainly browser runtimes) support it? 回答1: Yes, this is possible. AutobahnPython supports running WebSocket over any stream-based transport supported by Twisted like: TCP TLS Unix Domain Socket Pipes Serial Please see here. FWIW, it also supports tunneling any stream-based protocol over WebSocket. E.g. it allows you to run SSH over WebSocket (over any

Select() still blocks read from pipe

荒凉一梦 提交于 2019-12-11 13:08:55
问题 My application forks a child, the child execls a new program, the parent writes to it, and then reads back from the child after the child performs some work. When monitoring the read end of the pipe, the program still waits for the child. I'm currently not writing back to the parent, so it intentionally would block. Below is the code (the write_to() function closes the unused parts of the pipe in the function): pid_t leaf_proc; int rv = 0; int w_pfd[2]; int r_pfd[2]; if(pipe(w_pfd) == -1 ||

Write C function that returns int to Fortran

亡梦爱人 提交于 2019-12-11 12:15:01
问题 Ultimately I am trying to write an IPC calculator making use of Fortran to calculate and C to pass the data between the two Fortran programs. When I am done it will hopefully look like: Fortran program to pass input -> Client written in C -> Server written in C -> Fortran program to calculate input and pass ans back The C client/server part is done, but at the moment I am stuck trying to write a program that takes input in a Fortran program, passes it to a C program that calculates the answer