[ 
https://issues.apache.org/jira/browse/DIRMINA-996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16855959#comment-16855959
 ] 

Anton Vinokurov edited comment on DIRMINA-996 at 6/4/19 6:06 PM:
-----------------------------------------------------------------

I've just tested the method suggested by Paul. With a single session cache in 
the instance of IoSessionRecycler I hit the same issue: only a first (wrong) 
session is matched due to misuse of receiver socket information.

However if I subclass IoSessionRecycler and apply two different instances to 
two acceptors, it works good:

{{acceptor_auth = new NioDatagramAcceptor();}}
 acceptor_auth.setHandler(new RadiusServerHandler());
 acceptor_auth.setSessionRecycler(new MyIoSessionRecycler());
 {{acceptor_acct = new NioDatagramAcceptor();}}
 acceptor_acct.setHandler(new RadiusServerHandler());
 acceptor_acct.setSessionRecycler(new MyIoSessionRecycler());
 {{try {}}
 {{  acceptor_auth.bind(new InetSocketAddress(1812));}}
 {{  acceptor_acct.bind(new InetSocketAddress(1813));}}
 } catch (IOException e) {
 {{  e.printStackTrace();}}
 }

{{...}}

class MyIoSessionRecycler implements IoSessionRecycler { ...

}

 


was (Author: antonvn):
I've just tested the method suggested by Paul. With a single session cache in 
the instance of IoSessionRecycler I hit the same issue: only a first (wrong) 
session is matched due to misuse of receiver socket information.

However if I subclass IoSessionRecycler and apply two different instances to 
two acceptors, it works good:

{{acceptor_auth = new NioDatagramAcceptor();}}
acceptor_auth.setHandler(new RadiusServerHandler());
acceptor_auth.setSessionRecycler(new MyIoSessionRecycler());
 {{acceptor_acct = new NioDatagramAcceptor();}}
acceptor_acct.setHandler(new RadiusServerHandler());
acceptor_acct.setSessionRecycler(new MyIoSessionRecycler());
 {{try {}}
 {{  acceptor_auth.bind(new InetSocketAddress(1812));}}
 {{  acceptor_acct.bind(new InetSocketAddress(1813));}}
} catch (IOException e) {}}
 {{  e.printStackTrace();}}
}

{{...}}

{{class MyIoSessionRecycler implements IoSessionRecycler {...}}}

 

> IoSessionRecycler RemoteAddress Collision
> -----------------------------------------
>
>                 Key: DIRMINA-996
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-996
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.7
>            Reporter: Flavio Battimo
>            Assignee: Jonathan Valliere
>            Priority: Critical
>             Fix For: 2.1.4
>
>
> When using NioDatagramAcceptor with multiple binded local addresses the 
> IoSessionRecycler is not working as expected.
> If the acceptor has been prefilled with two sessions:
> remoteaddr=192.168.1.10:2001 localaddr=192.168.1.20:1000
> remoteaddr=192.168.1.10:2001 localaddr=192.168.1.20:1001
> so with same remote address but different local address, when the recycle 
> method of IoSessionRecycler interface is called only remote address is 
> passed. The recycler returns the same IoSession for incoming datagrams on two 
> different local addresses of the same acceptor.
> The IoSessionRecycler should have the local address parameter also in order 
> to find the correct IoSession.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to