this.socket = client.connect(this.host + ':' + this.port, <any>{ 'force new connection': true, 'reconnect': false
test('it should not crash when sent an empty message', function (t) { t.plan(1); var client = io.connect(socketURL, socketOptions); client.on('connect', function () { client.emit('message'); t.ok(true); }); });
angular.module(config.get("Client.appName")) .factory('socketio', ['socketFactory', function(socketFactory){ var mySocket = io.connect(''); return socketFactory({ ioSocket: mySocket }); }]);
io.on('disconnect',function(d){ io.connect() })
constructor(uri: string, opts: object = { autoConnect: false }) { this._socket = io.connect(uri, opts) }
public InitializeNetworking(): GenericOutcome { if (!ServerState.networkInitialized) { const socketToAuxProxy = io.connect(this.CreateURI(), this.CreateDefaultOptions()) const socketFromAuxProxy = io.connect(this.CreateURI(), this.CreateDefaultOptions()) this.sender = new AuxProxyMessageSender(socketToAuxProxy) this.network = new Network(socketToAuxProxy, socketFromAuxProxy, this) const outcome = this.network.Connect() ServerState.networkInitialized = outcome.Success return outcome } // Idempotent return new GenericOutcome() }
beforeAll(() => { httpServer = http.createServer(app).listen('5001'); socketIo.attach(httpServer); httpServerAddr = httpServer.address(); const connectUrl = `http://[${httpServerAddr.address}]:${httpServerAddr.port}`; const connectOption = { 'reconnection delay': 0, 'reopen delay': 0, 'force new connection': true, transports: ['websocket'], }; const ownerSocket = ioClient.connect(connectUrl, connectOption); const playerSocket = ioClient.connect(connectUrl, connectOption); ownerClient.setSocket(ownerSocket); playerClient.setSocket(playerSocket); });
function clientConnect (name, port) { const url = makeURL(port) const params = makeParams(name) return io.connect(url, params) }
it('Should force one coil', function(done) { var socket = io.connect(socketURL, options); socket.on('connect', function() { socket.emit('writeCoil', { "unit": 1, "address": 8, "state": true }); }); socket.on('data', function(data){ expect(data).to.have.property('data'); expect(data.data).to.equal(true); socket.disconnect(); done() }); });
beforeEach((done) => { client = io.connect(socketURL, options); client.on('connect', () => { done(); }); });
(function () { let instance; function createInstance() { const io = require('socket.io-client') const socket = io.connect(); return socket; } return { getInstance: function () { if (!instance) { instance = createInstance(); } return instance; } }; })()
this.socket = client.connect(this.host + ':' + this.port, <any>{ 'force new connection': true, 'reconnect': false
io.on('disconnect',function(d){ io.connect(); })
io.on('disconnect',function(d){ io.connect(); })
io.on('disconnect',function(d){ io.connect() })