Hi,
I’m looking at the methods on Server Connections | Meteor API Docs.
Looks like they’re all for client code though.
i.e. Meteor.getStatus()
only gets info about 1 client<->server connection, I want to be able to see all active ones.
I want the server to be able to list all active connections.
Is this possible? Thanks!
Edit: I just found out about Meteor.default_server.stream_server.all_sockets().length
through javascript - meteor currently active users? - Stack Overflow .
Haven’t tested it yet but will attempt to see if it works for me.
Edit: Looks like both Meteor.server.stream_server.open_sockets
and Meteor.default_server.stream_server.open_sockets
return an array of SockJSConnection
s
Does anybody know if there’s a difference?
It seems like this works in Chrome server debugger, but I keep getting []
when trying to console log in actual server code in Meteor.startup()
(I guess this makes sense)
Anyways, my use case is to detect amount of current open connections prior to running a cron job with SyncedCron
. So I’ll put this code there and see if it works.