N
N
Nwton2017-02-18 17:02:31
Node.js
Nwton, 2017-02-18 17:02:31

How to determine that io is running?

When starting the application, I want to be sure that the socket io is attached to the server and ready to accept requests. Actually, how to do it? Does io have an analogue of once open, like mongo?
I run it like this:io = require('socket.io')(server);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
leninlin, 2017-02-23
@Nwton

socket.io just hangs a handler on server. When server starts then io starts.
You can find out when the server starts in the callback of the listen method.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question