Skip to content
Kazuyuki Honda edited this page Mar 9, 2019 · 1 revision

Specification

$onconnect

  • Do nothing

$ondisconnect

  • Get room ID from connections table by connection ID
  • Broadcast {"type":"close"} message to members who is joining the room
  • Remove Client information from Room table

$default

  • Broadcast received message to members who is joining the room
  • Remove Client information from Room table if type=close

register

  • Create Room if not exists
  • Add Client info to the room
  • Return {"type":"accept"} if the room is not full
    • Add Client info to Rooms table
    • Add Connection info which represents relation between connection ID and Room ID
  • Return {"type":"reject"} if the room is full (Currently max capacity is 2)

echo (only for test)

  • Echo received message to connected client
Clone this wiki locally