dgram-stream
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -6,4 +6,4 @@ | ||
// setup the receiver | ||
var listenSock = dgram.createSocket('udp4') | ||
var listenStream = ds(listenSock); | ||
var listenSocket = dgram.createSocket('udp4') | ||
var listenStream = ds(listenSocket); | ||
@@ -19,9 +19,9 @@ listenStream.on('data', function(item) { | ||
// bind on the socket or stream works | ||
listenStream.bind(1234) | ||
listenSock.bind(1234) | ||
// setup the sender | ||
var sendSock = dgram.createSocket('udp4') | ||
var sendStream = ds(sendSock) | ||
var sendSocket = dgram.createSocket('udp4') | ||
var sendStream = ds(sendSocket) | ||
@@ -28,0 +28,0 @@ // send! |
@@ -78,2 +78,6 @@ var inherits = require('inherits'); | ||
DgramStream.prototype.bind = function() { | ||
return this.sock.bind.apply(this.sock, arguments); | ||
} | ||
function splitAddr(addr) { | ||
@@ -80,0 +84,0 @@ var i = addr.lastIndexOf(':'); |
{ | ||
"name": "dgram-stream", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "udp messages as a stream of objects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,3 +24,3 @@ # dgram-stream - udp as a duplex stream | ||
```json | ||
```js | ||
{ from: { address: '127.0.0.1', family: 'IPv4', port: 55230, size: 11 }, | ||
@@ -37,4 +37,4 @@ payload: <Buffer 6d 79 20 64 61 74 61> } | ||
// setup the receiver | ||
var listenSock = dgram.createSocket('udp4') | ||
var listenStream = ds(listenSock); | ||
var listenSocket = dgram.createSocket('udp4') | ||
var listenStream = ds(listenSocket); | ||
@@ -46,8 +46,8 @@ listenStream.on('data', function(item) { | ||
listenSock.bind(1234) | ||
listenSocket.bind(1234) | ||
// setup the sender | ||
var sendSock = dgram.createSocket('udp4') | ||
var sendStream = ds(sendSock) | ||
var sendSocket = dgram.createSocket('udp4') | ||
var sendStream = ds(sendSocket) | ||
@@ -54,0 +54,0 @@ // send! |
4142
96