| //One-shot server. Note that the server cannot send a reply; | ||
| //UNIX datagram sockets are unconnected and the client is not addressable. | ||
| var unix = require('unix-dgram'); | ||
| var server = unix.createSocket('unix_dgram', function(buf) { | ||
| console.log('received ' + buf); | ||
| server.close(); | ||
| }); | ||
| server.bind('/tmp/ain_test_socket.sock'); | ||
| //Send a single message to the server. | ||
| var message = Buffer('ping'); | ||
| var client = unix.createSocket('unix_dgram'); | ||
| client.on('error', console.error); | ||
| client.send(message, 0, message.length, '/tmp/ain_test_socket.sock'); | ||
| client.close(); | ||
+7
-2
| language: node_js | ||
| node_js: | ||
| - "0.10" | ||
| - "0.8" | ||
| - "0.12" | ||
| - "0.11" | ||
| - "0.10" | ||
| - "0.8" | ||
| - "0.6" | ||
| - "iojs" | ||
| - "iojs-v1.0.4" |
+5
-0
| # CHANGELOG | ||
| ## v1.5.2 | ||
| * Fix socket bind problem in combination with cluster.js for node verions > v0.10.x (Issue #33) | ||
| * Have travis test more node versions | ||
| ## v1.5.1 | ||
@@ -4,0 +9,0 @@ |
+12
-3
@@ -12,2 +12,13 @@ var dgram = require('dgram'); | ||
| var releaseTimeout | ||
| // HACK: On Node v0.11.x and v0.12.x bind the socket to ensure that it works when clustering | ||
| // This should be a temporary fix until node fixes the cluster module | ||
| var socketBindRequired = (function(){ | ||
| if(/^v0\.([0-9]|10)\..*$/.test(process.version)) { | ||
| return false; | ||
| } | ||
| else { | ||
| return true; | ||
| } | ||
| })(); | ||
| var socketErrorHandler = function (err) { | ||
@@ -46,5 +57,3 @@ | ||
| // HACK: On Node v0.11.x bind the socket to ensure that it works when clustering | ||
| // THis should be a temporary fix until node fixes the cluster module | ||
| if (/^v0\.11\..*$/.test(process.version)) { | ||
| if (socketBindRequired && type == 'udp4') { | ||
| socket.bind({ | ||
@@ -51,0 +60,0 @@ port: 0, |
+1
-1
| { | ||
| "name": "ain2", | ||
| "description": "Syslog logging for node.js. Continuation of ain", | ||
| "version": "1.5.1", | ||
| "version": "1.5.2", | ||
| "main": "./index", | ||
@@ -6,0 +6,0 @@ "author": "Alexander Dorofeev <aka.spin@gmail.com>", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
35638
2.93%16
6.67%781
2.9%