I just updated the code to hopefully make things more clear.  What I now do
is perform a lookup in the map for the IP address, if the IP address exists,
then I test get the value from the map with the key being the IP address.
The value from the map is the last connected time.  This time and the
current time are subtracted and if the result is less than the interval
time, then the session will be closed.  On each call to this method, I
updated the map with the current time.  This will ensure that the last
connected time from a specified IP address will get updated per connection
attempt.

I hope this clears things up.
Mark

On 6/23/07, liquidchen <[EMAIL PROTECTED]> wrote:



  it's greate to have this filter, but seems only the session first
connect
will be succ, others will all fail

JIRA [EMAIL PROTECTED] wrote:
>
>
>      [
>
https://issues.apache.org/jira/browse/DIRMINA-389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
>
> Work on DIRMINA-389 started by Mark Webb.
>
>> Create a Connection Throttle Filter
>> -----------------------------------
>>
>>                 Key: DIRMINA-389
>>                 URL: https://issues.apache.org/jira/browse/DIRMINA-389
>>             Project: MINA
>>          Issue Type: New Feature
>>          Components: Filter
>>    Affects Versions: 2.0.0-M1
>>         Environment: All
>>            Reporter: Mark Webb
>>            Assignee: Mark Webb
>>            Priority: Minor
>>             Fix For: 2.0.0-M1
>>
>>
>> Create a filter that will throttle connections.  This filter will
monitor
>> newly created sessions and if new connections from the same IP address
>> come in too fast, drop the connections.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
>

--
View this message in context:
http://www.nabble.com/-jira--Created%3A-%28DIRMINA-389%29-Create-a-Connection-Throttle-Filter-tf3968930.html#a11272049
Sent from the mina dev mailing list archive at Nabble.com.




--
..Cheers
Mark

Reply via email to