Roman Yakobchuk
Roman Yakobchuk

Reputation: 22

Trigger custom events on Socket.io

can you tell me how to trigger custom events on Socket.io to be able to manage not just it's own like io.sockets.on('connection', ...) But my custom io.sockets.on('session:reload', ...)

In older versions you could make it this way: io.sockets.$emit("session:reload", sid);

Upvotes: 0

Views: 1708

Answers (1)

Robert Rossmann
Robert Rossmann

Reputation: 12131

You can use socket.emit. See the docs.

Upvotes: 1

Related Questions