pad.pub0.org/doc/jsdoc/MessageHandler.md

33 lines
647 B
Markdown
Raw Normal View History

2011-05-30 14:53:11 +00:00
# MessageHandler
2011-05-29 20:30:56 +00:00
`require("./MessageHandler");`
2011-05-30 14:53:11 +00:00
The MessageHandler handles all Messages that comes from Socket.IO and controls the sessions
2011-05-29 20:30:56 +00:00
2011-05-30 14:53:11 +00:00
## Functions
2011-05-29 20:30:56 +00:00
2011-05-30 15:05:42 +00:00
- - -
2011-05-30 14:53:11 +00:00
### handleConnect (client)
2011-05-29 20:30:56 +00:00
Handles the connection of a new user
* **client** the new client
2011-05-30 15:05:42 +00:00
- - -
2011-05-30 14:53:11 +00:00
### handleDisconnect (client)
2011-05-29 20:30:56 +00:00
Handles the disconnection of a user
* **client** the client that leaves
2011-05-30 15:05:42 +00:00
- - -
2011-05-30 14:53:11 +00:00
### handleMessage (client, message)
2011-05-29 20:30:56 +00:00
Handles a message from a user
* **client** the client that send this message
* **message** the message from the client
2011-05-30 15:05:42 +00:00
- - -
2011-05-30 14:53:11 +00:00
### setSocketIO (socket_io)
A associative array that translates a session to a pad
2011-05-29 20:30:56 +00:00
* **socket_io** The Socket