| Max Hadley | 08:57 (5 hours ago) |
You could use such a node to receive test data generated by suitable script. By chance, I just also learned about jo http://jpmens.net/2016/03/05/a-shell-command-to-create-json-jo/ which might make another piece of a solution.
How does this look to you guys?
Max
| me (Julian Knight change) | 09:25 (5 hours ago) |
| Dave C-J | 11:34 (3 hours ago) |
ls | nc -U /Users/max/tst.socketI have now created a simple node-red-contrib-ipc (Inter-Process Communication) node and pushed it to Github. I've only really tested it on MAC OS X so far.
...
// SERVER sidevar NamedPipes = require('named-pipes');
var mypipe = 'pipeme3';server = NamedPipes.listen(mypipe);
server.on ('connect', function (client) { console.log('New Client') client.send('welcome', 'something') //# THis gets passed to emit on the client side});
// Client Side
pipe = NamedPipes.connect(mypipe)
pipe.on('welcome', function(str) { console.log(str) // # Outputs 'something'});
λ node namedpipe2.jsevents.js:141 throw er; // Unhandled 'error' event ^
Error: listen EADDRINUSE \\.\pipe\pipeme2 at Object.exports._errnoException (util.js:870:11) at exports._exceptionWithHostPort (util.js:893:20) at Server._listen2 (net.js:1223:19) at listen (net.js:1272:10) at Server.listen (net.js:1362:5) at PipeEmitter.listenToPipe (C:\Users\julian\.node-red\node_modules\named-pipes\lib\named-pipes.js:54:32) at new PipeEmitter (C:\Users\julian\.node-red\node_modules\named-pipes\lib\named-pipes.js:40:14) at Object.module.exports.listen (C:\Users\julian\.node-red\node_modules\named-pipes\lib\named-pipes.js:15:14) at Object.<anonymous> (C:\Users\julian\.node-red\namedpipe2.js:5:21) at Module._compile (module.js:409:26)I have now created a simple node-red-contrib-ipc (Inter-Process Communication) node and pushed it to Github. I've only really tested it on MAC OS X so far.
...
OK, I've had a quick try on Windows.The good news is that the listener starts listening!The bad news is that it appears to get exclusive use of the pipe and so I can't send anything to it.
...
| @pipeAddress = "\\\\.\\pipe\\#{@pipeName}" |
i hope your node (max) is wat i was searching for.
do i get it correct that your node is only setup as server side that can receive messages?
i need a bedirectional approche.
searching for a unix socket solution i found node-IPC here: https://github.com/RIAEvangelist/node-ipc
maybe it helps you.