Nodejs MaxSockets

233 views
Skip to first unread message

Tolgay Toklar

unread,
Aug 11, 2013, 5:12:09 AM8/11/13
to nod...@googlegroups.com
Hi

I am using socket.io (with xhr-polling) but after 5 connections socket.io hangs.I want to remove this limit,I wrote this code in my app.js (server)

var io=require('socket.io');
var http=require('http');
http.globalAgent.maxSockets = 20;
http.Agent.maxSockets = 20;
var server = http.createServer().listen(
8440);
io = io.listen(server);
io.set('transports', [
  , 'xhr-polling'
  , 'websocket'
  , 'jsonp-polling'
  ]);


But Didn't work I still have 5 connection limit.When I was use this code


var io=require('socket.io');
var http=require('http').globalAgent.maxSockets = 20;
var server = http.createServer().listen(
8440);
io = io.listen(server);
io.set('transports', [
  , 'xhr-polling'
  , 'websocket'
  , 'jsonp-polling'
  ]);


I am getting this error message

Object 30 has no method createServer()


How can I resolve this ? I searched all internet but didn't find any solution.Please help me

Maziyar S.P.

unread,
Dec 18, 2013, 2:19:55 AM12/18/13
to nod...@googlegroups.com
Hi, 

Have you found anything for this? What was the problem and how do check to see that it's still 5?

Tolgay Toklar

unread,
Dec 18, 2013, 4:25:49 AM12/18/13
to nod...@googlegroups.com
Hi

Yes! I created dynamic subdomains like socket15.c.domain.com socket16.c.domain.com my algorithm is socket<random_number>.c.domain.com I redirected *.c.domain.com to ip adress and my problem resolved. :) 


2013/12/18 Maziyar S.P. <sm.shari...@gmail.com>

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/a4Dy0y8vsE4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Tolgay Toklar
Bursa,Turkey
Reply all
Reply to author
Forward
0 new messages