[JBoss JIRA] Commented: (NETTY-311) Add connection limit handlers

Benoit Sigoure (JIRA) jira-events at lists.jboss.org
Sun May 2 23:38:05 EDT 2010


    [ https://jira.jboss.org/jira/browse/NETTY-311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12528563#action_12528563 ] 

Benoit Sigoure commented on NETTY-311:
--------------------------------------

In ConnectionLimitUpstreamHandler#channelOpen, instead of doing currentCount = connections.getAndIncrement() and then checking currentCount + 1 > maxConnections you could instead do currentCount = connections.incrementAndGet() and then check currentCount > maxConnections.

Also, I'm not sure why you're checking whether maxConnections > 0.  The API doesn't document that 0 is a legitimate value to disable this check.  I'd argue that if the value is 0, you shouldn't add this handler in your pipeline.  If maxConnections <= 0, I think the constructor should throw an IllegalArgumentException.

> Add connection limit handlers
> -----------------------------
>
>                 Key: NETTY-311
>                 URL: https://jira.jboss.org/jira/browse/NETTY-311
>             Project: Netty
>          Issue Type: Feature Request
>          Components: Handler
>            Reporter: Norman Maurer
>            Assignee: Trustin Lee
>         Attachments: ConnectionLimitUpstreamHandler.java, ConnectionPerIpLimitUpstreamHandler.java
>
>
> Netty does not ship any connection limit handlers. This should be changed. I think its a common problem users want to solve

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the netty-dev mailing list