axon
axon copied to clipboard
refuse connections...is reach max connections setting
in pub/sub pattern
if I want set max connections number...
there is no method to refuse connction...
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
TODO: add `.set('max connections', Number).