5
votes

(sorry for my english)

It's possible to build an application (2 in deed ) that implement bidirectional communication between process?.

I know two "Frameworks" to communicate different process (in different languages) Thrift and Protocol buffers.

I know that thrift works in a client/server mode, so if i want bidirectional communication i need to build the two sides/process like a client and server at time.

client/server <-------------------------> client/server

I don't know if this approach is correct.

But.. i can't find information about this using Protocol Buffers. is this possible?

I have a C++ process and a Node.js (Javascript) application .. the C++ process send a notification to de Node.js app (this works good, i use thrift to test) ..

In the other side, the user interact with the Node.js app.. in some event, the node.js app need to notify to de C++ process .. so i need bidirectional communication..

Any idea?

Thanks in advance

1
At the lowest level of transport-oriented networking, you do always have a client and a server, because the server is the one that listen()s and accept()s, while the client is the one that connect()s, but after that there's no further asymmetry in the communication. If both processes sit on the same machine, you could use a pipe.Kerrek SB
Clearly in a low level we always have a client/server .. but in the high level implementation the idea is to see or work with only one channel... i try to accomplish this..matiasfha
Well, as soon as you have established a connection, the picture is fairly symmetric. Both sides can send and receive equally.Kerrek SB
@Kerrek SB: That isn't strictly true. It's possible for two programs to both call bind and then each call connect essentially simultaneously. This results in the simultaneous SYN exchange method of creating a TCP connection.Omnifarious
@Omnifarious: Very interesting. Why not post that as an answer? Is that a feasible approach?Kerrek SB

1 Answers

3
votes

This post has some options for Thrift - Callbacks in Thrift Asynchronous Functions?

msdark's question is really about bidirectional event signaling and not simply bidirectional data transfer. Data may be transferred in both directions using Thrift or ProtoBufs. Fundamentally any IPC must transfer data both ways -- an RPC call and return value(s). Asynchronous client to server event signaling is built in using an RPC, but async server to client takes more work. There has been work in that area. The top two results in a Google search for 'thrift async' are good reads.

Thrift: Bidirectional Async RPC

etc...