From c23fa0a4301b72b0ad7c231fecf09959b8af74d2 Mon Sep 17 00:00:00 2001 From: Rob McGuire-Dale Date: Fri, 24 Apr 2015 15:20:14 -0700 Subject: [PATCH] Basic examples corrections With the basic examples verbatim, the server was throwing the following error ``` .../sandbox/node_modules/node-ipc/lib/socketServer.js:34 socket.write( ^ TypeError: undefined is not a function ... ``` Adding the missing `socket` reference on line 536 corrected this problem. There was also an error in the `require` statement. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 64d6f95..683ae81 100644 --- a/README.md +++ b/README.md @@ -353,6 +353,7 @@ The server is the process keeping a socket for IPC open. Multiple sockets can co function(data,socket){ ipc.log('got a message : '.debug, data); ipc.server.emit( + socket, 'message', data+' world!' ); @@ -366,7 +367,7 @@ The server is the process keeping a socket for IPC open. Multiple sockets can co #### Client for Unix Sockets & TCP Sockets The client connects to the servers socket for Inter Process Communication. The socket will recieve events emitted to it specifically as well as events which are broadcast out on the socket by the server. This is the most basic example which will work for both local Unix Sockets and local or remote network TCP Sockets. - var ipc=require('../../../node-ipc'); + var ipc=require('node-ipc'); ipc.config.id = 'hello'; ipc.config.retry= 1500;