Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refuse connections...is reach max connections setting #114

Open
lemonhall opened this issue Dec 1, 2013 · 2 comments
Open

refuse connections...is reach max connections setting #114

lemonhall opened this issue Dec 1, 2013 · 2 comments

Comments

@lemonhall
Copy link

in pub/sub pattern

if I want set max connections number...

there is no method to refuse connction...

@lemonhall
Copy link
Author

OK,I got one method to refuse connections...

var c=0;

sock.on("connect",function(){
//console.log(sock.socks[c]);
console.log("connections:"+c+"===============================");
if(c>2){
var peer=sock.socks[c];
peer.write(this.pack("refuse"));
//if (peer.writable) peer.write("refuse");
//peer.destroy();
}
c=c+1;

});

bug you should expose a method to do it

@gjohnson
Copy link
Collaborator

gjohnson commented Feb 3, 2014

TODO: add `.set('max connections', Number).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants