-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Igal edited this page May 27, 2017
·
10 revisions
The WebSocket API is Event-Driven, meaning that you implement in your code event handlers, which are called when the corresponding events are triggered.
You do that by creating a Listener Component API which implements any of the event handlers, and then you register that Listener Component with the WebSocket endpoint by using the WebsocketRegister() function.
Many of the event handlers receive a WebSocket object as an argument, which allows you to interact with the remote connection on a low level, or retrieve information or references to other useful objects.
One of those useful objects is the ConnectionManager, which keeps track of the active connections, and lets you broadcast messages to different channels.