From 0659d08fc3cfc3696379e2ed56c75bdadc751a1f Mon Sep 17 00:00:00 2001 From: Brandon Nozaki Miller Date: Sat, 22 Aug 2015 23:51:04 -0700 Subject: [PATCH] prepped for release --- README.md | 53 ++++++++++++++++++++++++++++++++++++++- package.json | 2 +- testHarness/npm-debug.log | 37 --------------------------- 3 files changed, 53 insertions(+), 39 deletions(-) delete mode 100644 testHarness/npm-debug.log diff --git a/README.md b/README.md index 446124e..7ee7b69 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Set these variables in the ``ipc.config`` scope to overwrite or set default valu | id | the id of this socket or service | | networkHost| the local or remote host on which TCP, TLS or UDP Sockets should connect | | networkPort| the default port on which TCP, TLS, or UDP sockets should connect | -| encoding | the default encoding for data sent on sockets | +| encoding | the default encoding for data sent on sockets. Mostly used if rawBuffer is set to true. Valid values are : ` ascii` ` utf8 ` ` utf16le` ` ucs2` ` base64` ` hex ` . | rawBuffer| if true, data will be sent and recieved as a raw node ` Buffer ` __NOT__ an ` Object ` as JSON. | | silent | turn on/off logging default is false which means logging is on | | maxConnections| this is the max number of connections allowed to a socket. It is currently only being set on Unix Sockets. Other Socket types are using the system defaults. | @@ -477,3 +477,54 @@ This is the most basic example which will work for both local Unix Sockets and l ipc.server.define.listen.message='This event type listens for message strings as value of data key.'; ipc.server.start(); + +#### Binary or Buffer Sockets +Binary or Buffer sockets can be used with any of the above socket types, however the way data events are emit is ***slightly*** different. + +When setting up a rawBuffer socket you must specify it as such : + + ipc.config.rawBuffer=true; + +You can also specify its encoding type. The default is ` utf8 ` + + ipc.config.encoding='utf8'; + + +emit string buffer : + + //server + ipc.server.emit( + socket, + 'hello' + ); + + //client + ipc.of.world.emit( + 'hello' + ) + +emit byte array buffer : + + //server + ipc.server.emit( + socket, + [10,20,30] + ); + + //client + ipc.server.emit( + [10,20,30] + ); + +emit hex array buffer : + + //server + ipc.server.emit( + socket, + [0x05,0x6d,0x5c] + ); + + //client + ipc.server.emit( + [0x05,0x6d,0x5c] + ); \ No newline at end of file diff --git a/package.json b/package.json index 5ebd2d1..1f51931 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-ipc", - "version": "1.3.0", + "version": "2.0.0", "description": "A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.", "main": "node-ipc.js", "directories": { diff --git a/testHarness/npm-debug.log b/testHarness/npm-debug.log deleted file mode 100644 index a9c354c..0000000 --- a/testHarness/npm-debug.log +++ /dev/null @@ -1,37 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ 'node', '/home/bmiller/.nvm/v0.10.30/bin/npm', 'publish' ] -2 info using npm@1.4.23 -3 info using node@v0.10.30 -4 verbose publish [ '.' ] -5 verbose cache add [ '.', null ] -6 verbose cache add name=undefined spec="." args=[".",null] -7 verbose parsed url { protocol: null, -7 verbose parsed url slashes: null, -7 verbose parsed url auth: null, -7 verbose parsed url host: null, -7 verbose parsed url port: null, -7 verbose parsed url hostname: null, -7 verbose parsed url hash: null, -7 verbose parsed url search: null, -7 verbose parsed url query: null, -7 verbose parsed url pathname: '.', -7 verbose parsed url path: '.', -7 verbose parsed url href: '.' } -8 silly lockFile 3a52ce78- . -9 verbose lock . /home/bmiller/.npm/3a52ce78-.lock -10 silly lockFile 3a52ce78- . -11 silly lockFile 3a52ce78- . -12 error addLocal Could not install . -13 error Error: ENOENT, open 'package.json' -14 error If you need help, you may report this *entire* log, -14 error including the npm and node versions, at: -14 error -15 error System Linux 3.13.0-34-generic -16 error command "node" "/home/bmiller/.nvm/v0.10.30/bin/npm" "publish" -17 error cwd /home/bmiller/git/node-ipc/testHarness -18 error node -v v0.10.30 -19 error npm -v 1.4.23 -20 error path package.json -21 error code ENOENT -22 error errno 34 -23 verbose exit [ 34, true ]