Questions tagged [socket.io-1.0]

The latest version of Socket.IO library.

Socket.IO enables real-time bidirectional event-based communication. It works on every platform, browser or device, focusing equally on reliability and speed.

Migrating from 0.9.x

255 questions
6
votes
0 answers

Socket.IO checking if room contains clients with socket.io-redis

What is "efficient way" to check if some room has connected clients or even exists? socket.on('pm', function(data) { data.from = socket.decoded_token._id; var to = data.to; if (_.isUndefined(io.sockets.adapter.rooms[to])) { …
Danil
  • 2,497
  • 2
  • 19
  • 27
6
votes
2 answers

Connect to socket.io(nodejs) via PHP

I had a need to connect to websocket via php, send data and immediately disconnect. No need to wait for a response from the socket. I used elefant.io but after updating the library does not work. Please tell me how to connect to websocket via PHP?
DuckHunter
  • 91
  • 1
  • 6
6
votes
2 answers

How to do RPC over socket.io?

Suppose we have a simple echo server (tuned to be longer on the first request): var waiting = 8000; io.on('connection', function(socket){ socket.on('doEcho', function (data) { setTimeout( function () { …
cibercitizen1
  • 20,944
  • 16
  • 72
  • 95
5
votes
0 answers

Node.js RSS much higher than Heap

Just a simple question about Node.js memory usage. Is it normal for Node? Take a look at this: { rss: 788246528, heapTotal: 110231552, heapUsed: 67313680, external: 90448493 } I'm using socket.io lib, Total socket.io clients: 2378 When I…
DoctorP
  • 159
  • 2
  • 10
5
votes
4 answers

io.sockets.socket(socket_id).emit() - has no method 'socket'

im running a nodejs server + express + socket.io version 1.0.4 and everything works as expected in my app, but i just cant emit a message from server side to client side via: socket_server.sockets.socket(socket_id).emit("message", data); when i…
Mafu
  • 115
  • 1
  • 1
  • 8
4
votes
0 answers

Should I pass Socket.io-client instance as props or not? (React example)

This is a topic that has been discussed a lot, but everyone keeps saying the opposite of each other, hence I created this question to hopefully clear all doubts. This article teaches you how to pass Socket.io in context. However, the first comment…
4
votes
0 answers

Android how to transfer real-time stream videos to a node js server

I'm an android developer but a noob in nodejs.I want to create a live radio appliction so I use android to create the client app and nodejs to create the server. Step: Android : MediaRecord to record video and transfer to nodejs server. Nodejs…
CytQ
  • 41
  • 1
  • 2
4
votes
1 answer

Socket.IO Client How to Connect?

I was following the second example here: https://github.com/socketio/socket.io-client and trying to connect to a website that uses websockets, using socket.io-client.js in node. My code is as follows: var socket =…
user7337732
  • 71
  • 1
  • 1
  • 5
4
votes
1 answer

Is it possible to add several handlers to the same socket.io.on event?

In my game application I would like to have general class for handling socket connection and authorization and several classes for event handling, in such a way: //loading game/lobby/other socket routers ... var socketRouter = function(server) { …
Arsenii Fomin
  • 3,120
  • 3
  • 22
  • 42
4
votes
1 answer

socket.io 1.0.0^ : Using the default room vs a custom room for user specific communications

socket.io 1.4.5 , node.js 5.x Forward : A lot of reading, effort, and failure came before this post - so I hope it helps out a lot of future readers. The option of using the default room has confused me when I consider how to use rooms for user…
Nick Pineda
  • 6,354
  • 11
  • 46
  • 66
4
votes
2 answers

What happens with unhandled socket.io events?

Does socket.io ignore\drop them? The reason why Im asking this is the following. There is a client with several states. Each state has its own set of socket handlers. At different moments server notifies the client of state change and after that…
Dmitry Isakov
  • 580
  • 5
  • 18
4
votes
2 answers

Connection between Socket.IO and HapiJS

We have a REST server implemented with HapiJS and a Websockets server implemented with Socket.IO (they are both running on a single server but on different ports). I want to notify the Websockets server from the HapiJS server to send an event with…
NMP
  • 490
  • 1
  • 5
  • 17
4
votes
1 answer

socket.io doens't work with transports: [ 'xhr-polling' ]

I'm trying to test fallback to polling in socket.io, in order to verify that my app works with clients that don't support websockets for whatever reason. I am using the very basic server/client example for Express 4. It works fine with: //…
George Armhold
  • 30,824
  • 50
  • 153
  • 232
4
votes
1 answer

Socket.io 1.x clustering without sticky session?

Is there any way to cluster Socket.io without these sticky session, with Redis?
Unitech
  • 5,781
  • 5
  • 40
  • 47
4
votes
0 answers

Node.js Redis transaction: concurrent watch on single connection

Playing with nodejs, socket.io and redis transaction. Wondering what would happen with this code (dummy code) var redis = require('redis'); var client = redis.createClient(); ... socket.on('setSomeKey', function() { …
Nihau
  • 474
  • 3
  • 20
1 2
3
16 17