import { Server } from "https://deno.land/x/sockets@v0.5.0/src/server.ts";
The SocketServer
class is responsible for creating a users socket server.
Similar to how Drash.Http.Server creates a server instance.
Constructors
Construct an object of this class.
Properties
A property to hold the Deno server. This property is set in this.run() like so:
this.deno_server = serve();
A property to hold the transmitter. The transmitter is in charge of transmitting data throughout the server-client lifecycle.
Methods
Accept incoming web sockets as clients.
Handle a binary message sent by the socket client.
Handle a message in the format of a JSON string.
Handle a string message sent by the socket client.
Close the server.
Handles websocket connection. After a successful connection, the client will be added to EventEmitter.clients and the server will start listening to events.
Handles websocket secure connection. After a successful connection, the client will be added to EventEmitter.clients and the server will start listening to events.