How do I wait for successful connection using DDP (server -> server)

Continuing the discussion from DDP: how do I wait for a connection?:

Based on the thread above, we an leverage tracker.autorun to wait and confirm for a successful connection between a client and meteor server.

I would like to do the same on a server : server connection

Basically, I have a meteor server (server1), that will need to “test” and see if another meteor server (server2) is available.

Each time I run DDP.connect(remoteUrl).status() within server1’s meteor method, it always says “connection”. I know it connects in the next second or two, but I’m unable to wait for checking the connection success flag.

How do i do this on the server?

Thanks

You could implement a “ping” Meteor method on the target server. Make a call to it, and if it fails, you know the connection isn’t alive.

Thanks. By ping as in the usual npm / linux ping? It might not be foolproof if ping responses are blocked

No, I mean a Meteor method. You might send some kind of token for security reasons, and you might return some kind of status information in the reply

Thx. I cross posted this on SO and got a footing.

I have an extension related to the same question regarding trusting CA certificates on DDP.connect. I will post a new post on that.