Cross-Platform Desktop Application Development: Electron, Node, NW.js, and React by Dmitry Sheiko

Cross-Platform Desktop Application Development: Electron, Node, NW.js, and React by Dmitry Sheiko

Author:Dmitry Sheiko [Dmitry Sheiko]
Language: eng
Format: epub
Tags: Computers, Programming Languages, JavaScript, General, Desktop Applications, Html
ISBN: 9781788295697
Google: -eZDDwAAQBAJ
Amazon: 1788295692
Publisher: Packt Publishing Ltd
Published: 2017-07-27T00:00:00+00:00


export default class Server {

constructor() {

this.server = ws.createServer(( conn ) => {

conn.on( "error", ( err ) => {

console.error( "Server error", err );

});

conn.on( "close", ( code, reason ) => {

console.log( "Server closes a connection", code, reason );

});

conn.on( "connection", () => {

console.info( "Server creates a new connection" );

});

});

}

broadcast( event, data ){

const text = Message.toString( event, data );

this.server.connections.forEach( conn => {

conn.sendText( text );

});

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.