July 2019
Intermediate to advanced
416 pages
10h 6m
English
We have now reached the point where we are ready to bring Socket.IO into our server and create a running server implementation. Run the following command to incorporate Socket.IO and the related DefinitelyTyped definitions:
npm install --save socket.io @types/socket.io
With these definitions available to us, we are going to bring Socket.IO support into our server and begin running it, ready to receive and transmit messages:
export class SocketServer { public Start() { const appSocket = socket(3000); this.OnConnect(appSocket); } private OnConnect(io: socket.Server) { }}new SocketServer.Start();
The parameter that our OnConnect method receives is the starting point for receiving and reacting to messages ...
Read now
Unlock full access