socket.io-stream
socket.io-stream copied to clipboard
Auto reconnect?
Add these parameters in constructor options. eg:
var socket = require('socket.io-client')('http://localhost:8000', { reconnection: true, reconnectionDelay: 100, reconnectionAttempts: Infinity });
in this case I'm setting the reconnection to try every 100ms.
And what I need to do is create a new stream after reconnect?
socket.on('connect', ()=>{
var stream = ss.createStream()
ss(socket).emit('dnode',stream)
d.pipe(stream).pipe(d)
})
The settings you pass within the connect event should remain constant once reconnection occurs. Test the code with reconnect options and post your output (just use simple console logs on server and client to register events).
On 4 Feb. 2017, at 6:57 pm, tiaod [email protected] wrote:
And what I need to do is create a new stream after reconnect?
socket.on('connect', ()=>{ var stream = ss.createStream() ss(socket).emit('dnode',stream) d.pipe(stream).pipe(d) }) — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.