Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
Socketio specific client join room

I know that I can use

socket.join(room);

But it's not what I want. I want to choose specific client connected to server and make him join room. So it would looks like that:

OpEhq_0m7wzkZenVAAAB.join(room)

Where OpEhq_0m7wzkZenVAAAB is a single client.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

To make client join room you have to get clients object then you can join using that,to get that clients object you have to store clients object in array on connection like this,

var i;
io.on('connection', function(socket){
    array[i]=socket;
    i++;
}

afterwards if you want to make specific client join room you can do,

array[0].join(room);
array[1].join(room);

Hope it will help..!

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!