mondora / asteroid

An alternative client for a Meteor backend
MIT License
734 stars 101 forks source link

Connection fail event #77

Open geekgonecrazy opened 8 years ago

geekgonecrazy commented 8 years ago

@pscanf

I might be missing something, but there seems to not be a way to cleanly tell if the connection attempt has failed?

An event or callback either one would work fine.

geekgonecrazy commented 8 years ago

Disconnect would also be useful

webdeb commented 8 years ago

+1

webdeb commented 8 years ago

need some way to check the connection status

webdeb commented 8 years ago

@geekgonecrazy I found the socket_close event. It's called on the ddp client itself. You can make use of it this way:

var connection = new Asteroid('localhost:3000')
connection.ddp.on('socket_close', function() {
  console.log('connection closed, or could not be established');
})
geekgonecrazy commented 8 years ago

@webdeb oh sweet! That's an ok work around at least :+1: Thanks!

So there are probably other events we could grab this way too.

infacq commented 7 years ago

is this consider done? I thought to explore more on Meteor.status()