axon icon indicating copy to clipboard operation
axon copied to clipboard

refuse connections...is reach max connections setting

Open lemonhall opened this issue 11 years ago • 2 comments

in pub/sub pattern

if I want set max connections number...

there is no method to refuse connction...

lemonhall avatar Dec 01 '13 03:12 lemonhall

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

lemonhall avatar Dec 01 '13 04:12 lemonhall

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

gjohnson avatar Feb 03 '14 06:02 gjohnson