Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto reconnect? #99

Open
tiaod opened this issue Feb 3, 2017 · 3 comments
Open

Auto reconnect? #99

tiaod opened this issue Feb 3, 2017 · 3 comments

Comments

@tiaod
Copy link

tiaod commented Feb 3, 2017

No description provided.

@tiaod tiaod changed the title Auto reconnect? Auto reconnect? Feb 3, 2017
@sidewaiise
Copy link

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.

@tiaod
Copy link
Author

tiaod commented Feb 4, 2017

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)
    })

@sidewaiise
Copy link

sidewaiise commented Feb 4, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants