Created
January 24, 2013 16:40
-
-
Save geNAZt/4624773 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MuxDemux = require('mux-demux'); | |
var net = require('net'); | |
var BufferStream = require("buffer-stream") | |
function StreamConnection() { | |
var mdm1 = MuxDemux(); | |
var con = net.connect(8642); | |
con.pipe(mdm1).pipe(con); | |
var bufferStream = BufferStream().buffer(); | |
var ds1 = mdm1.createStream('update'); | |
ds1.pipe(bufferStream).pipe(ds1); | |
setInterval(function () { | |
bufferStream.write("test"); | |
}, 3 * 1e3); | |
} | |
StreamConnection(); | |
StreamConnection(); | |
StreamConnection(); | |
StreamConnection(); | |
StreamConnection(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment