Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor client disconnected event on server

Simple question, maybe simple answer: how do I know on the server that a certain client has disconnected? Basic use case: the serve would need to know if a player has dropped the connection.

like image 552
Bence Avatar asked Sep 08 '12 19:09

Bence


1 Answers

In the publish function, you can watch socket close event as follows.

this.session.socket.on "close", -> # do your thing
like image 172
poordeveloper Avatar answered Sep 19 '22 01:09

poordeveloper