Channel 0, does a few things. It responds to all pings with pongs, it handles opening/attaching channels, and it handles closing channels. It normally makes more sense for it to not be implemented as all other services are, but for it to be implemented directly in the message handling function. Messages to channel 0 are also blocking, unlike all other messages.
The simplest task of Channel 0, is responding to all Ping
's with Pong
. Let's say it receives the following message:
{
"channel": 0,
"ping": {},
"ref": "1u5g5btygmy"
}
The server would immediately send back:
{
"session": 123,
"pong": {},
"ref": "1u5g5btygmy"
}
Making sure to use the same ref
that was sent with the Ping
, and making sure to attach the right session id.
Some info from the old developer docs.