Two-way communication using Cromis IPC

I downloaded and played with the Cromis IPC components from Iztok Kacin.

I downloaded this component to allow my windows service and GUI to communicate. However, it seems that the message is one way (other than server responses).

I can happily send a message from the client to the listening server, but it seems I can not send the message to the client if it is not a response.

Does anyone know if two communication lines are available with these components, or do I need a server and a client both in the graphical interface and in service applications?

+4
source share
3 answers

I am the author of the components, and others have already told you that at the moment there is no way to make two-way communication. The reason is simple, her work by name works. It would be very difficult to maintain constant communication between the client and the server, and, frankly, IPC is not about that. But since there are times when you need to receive notifications about the availability of new data, I think about the transition of an independent signaling mechanism. Thus, the server can notify the client that there is something for it. Then the client will access the data in the same way as now. I now advocate implementing this as a completely separate component, which will then be easy to use with my IPC.

Follow the blog as I will post it there if I decide to do it.

+5
source

You will need a server and client on both sides.

+5
source

Short answer:

Cromis IPC is a named pipe. The client is responsible for sending a set of commands, which should be defined as the application protocol. The corresponding server listens to clients and acts as a processor for processing these protocol requests. In your case, you want to have bidirectional communication, so you must create a client and server for both processes with two protocols.

Long answer:

You can use Cromis IPC to do this work. As I described above, you need to define two protocols for specific applications and write protocol clients and protocol processors yourself. This is a wonderful job.

I recently ran into Apache Thrift . Apache Thrift is committed to providing a highly efficient IPC infrastructure. One of the fantastic features of Apache Thrift is that it can automatically generate IPC code itself. And he supports Delphi.

You just need to define the protocols of specific applications in the specification file. Thrift will create the appropriate client and processor code for you. It also supports not only Named Pipe, you can choose sockets or other transport implementations. It is really worth a try.

0
source

Source: https://habr.com/ru/post/1401858/


All Articles