Confirmed users
177
edits
Line 7: | Line 7: | ||
A better choice is for the actor to do all clean up itself when it's notified that the connection goes away. Then there's no need for the client to send any clean up message, and we know the actor will be in a good state no matter what. | A better choice is for the actor to do all clean up itself when it's notified that the connection goes away. Then there's no need for the client to send any clean up message, and we know the actor will be in a good state no matter what. | ||
For actors that are the first to be managed by protocol.js in an actor (this applies to anything that is a child of the root actor), you can do this by implementing your actor's <code>disconnect</code> method: | For actors that are the first to be managed by protocol.js in an actor tree (this applies to anything that is a child of the root actor which you would add to server/main.js), you can do this by implementing your actor's <code>disconnect</code> method: | ||
<nowiki> | <nowiki> |