socket.emit('hotword-detected', obj) })
agent.socket.disconnect(); agent.log.error('Disconnect...'); }); (function (actor) { actor.on('error', function (error: Error) { agent.socket.emit('error', error); }); if (conf.master.interval <= 0) { this.reconnecting = true; if (agent.socket != null) { agent.socket.disconnect(); agent.connected = false; }) { try { this.socket.emit(event, message);
it('when another client connect server should emit correct "presence"', function(done) { newSocket = socketClient(config.SELF_URL); newSocket.on('presence', function(presence) { expect(presence).to.be.an('object'); expect(presence).to.have.property('numUsers'); expect(presence.numUsers).to.equal(1); newSocket.off('presence'); done(); }); });
//set up the socket and begin talking with the server function beginGame() { socket = socketIoClient(); setupPlaySocket(socket); init(); }
socket.on('loggedin', data => { if (data.error) { return consoleOut(data.error); } consoleOut('Login successful!'); nick = data.username; authToken = data.token; readline.setPrompt(color(`${nick}: `, 'red')); readline.prompt(); });
connect.io.on('connect', function() { Router.run(routes, Router.HistoryLocation, function(Handler) { ReactDOM.render( React.createElement(Handler), document.getElementById('content') ); }); });
//Inform client that has been disconnected ioClient.on('disconnect', function () { console.log("DISCONNECTED FROM LOADBALANCER SERVER"); Clock.pause(); });
function spectate(){ socket = socketIoClient(); setupSpectateSocket(socket); init(); }
// Auth success handler. socket.on('loginConfirmed', userName => { // Join room named 'default'. socket.emit('roomJoin', 'default', (error, data) => { // Check for a command error. if (error) { return } // Now we will receive 'default' room messages in 'roomMessage' handler. // Now we can also send a message to 'default' room: socket.emit('roomMessage', 'default', { textMessage: 'Hello!' }) }) })
// =================================================== \\ // ====================SOCKET-IO====================== \\ // =================================================== \\ nodeRatIo.on("connect", function(socket){ console.log("[SYSTEM] Client try connecte to cloud."); // Connexion au Cloud node nodeRatIo.emit("initNodeClient", { 'client_serial' : client_serial, 'client_key' : client_key, 'cloud_password' : cloud_password }); });
agent.socket.disconnect(); agent.log.error('Disconnect...'); }); (function (actor) { actor.on('error', function (error: Error) { agent.socket.emit('error', error); }); if (conf.master.interval <= 0) { this.reconnecting = true; if (agent.socket != null) { agent.socket.disconnect(); agent.connected = false; }) { try { this.socket.emit(event, message);