nodejs + executable + high throughput bidirectional channel

28 views
Skip to first unread message

new_user

unread,
Mar 22, 2015, 11:33:51 AM3/22/15
to nod...@googlegroups.com
Hi 
I am trying to have node communicate easily with a spawned linux executable. 
The executable is already using stdout, so I need other paths for node-> exe and exe-> node  and which is capable of high throughput (eg: 100mbps)
I see a lot of node-> node examples  but am unsure how it looks like with C
Is there a simple example someone can point me to ?

thanks 

Aria Stewart

unread,
Mar 22, 2015, 11:55:41 AM3/22/15
to nod...@googlegroups.com

You could use a pipe on another file descriptor, setting it up when you spawn the executable. You could use a TCP or unix-domain socket to communicate, like any network process. Unix domain sockets are a tad more efficient, but even TCP on localhost is going to be able to pass a huge amount of traffic unless you're in a wacky VPS that does strange things to the lo device.

You could even use named pipes in the filesystem -- use mkfifo, and open them for reading / writing in the appropriate process to pass data back and forth.

Hope this helps

Aria
Reply all
Reply to author
Forward
0 new messages