You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2007/07/09 06:06:04 UTC

[jira] Resolved: (DIRMINA-395) DatagramSessionImpl getLocalAddress doesn't return the local address

     [ https://issues.apache.org/jira/browse/DIRMINA-395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trustin Lee resolved DIRMINA-395.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.4
         Assignee: Trustin Lee

Thank you Adam.  Your patch has been applied to branches/1.0 and branches/1.1.

> DatagramSessionImpl getLocalAddress doesn't return the local address
> --------------------------------------------------------------------
>
>                 Key: DIRMINA-395
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-395
>             Project: MINA
>          Issue Type: Bug
>          Components: Transport
>    Affects Versions: 1.1.0
>         Environment: All OSes
>            Reporter: Adam Fisk
>            Assignee: Trustin Lee
>             Fix For: 1.0.4, 1.1.1
>
>         Attachments: datagramLocalHostConnectorPath.patch
>
>
> I don't fully understand the comment in the constructor below, but I believe it's only relevant for acceptors, not connectors.  In the case of connectors, the "serviceAddress" argument below is just the remote host address, which should clearly not be set to the local address as it is.
>     DatagramSessionImpl( IoService wrapperManager,
>                          DatagramService managerDelegate,
>                          IoServiceConfig serviceConfig,
>                          DatagramChannel ch, IoHandler defaultHandler,
>                          SocketAddress serviceAddress )
>     {
> .....
>         // We didn't set the localhost by calling getLocalSocketAddress() to avoid
>         // the case that getLocalSocketAddress() returns IPv6 address while
>         // serviceAddress represents the same address in IPv4.
>         this.localAddress = this.serviceAddress = serviceAddress;
> ....
> This is called from DatagramConnectorDelegate in the registerNew method, which reads:
>             DatagramSessionImpl session = new DatagramSessionImpl(
>                 wrapper, this,
>                 req.config,
>                 req.channel, req.handler,
>                 req.channel.socket().getRemoteSocketAddress() );
> The last argument "req.channel.socket().getRemoteSocketAddress()" should clearly not be assigned to the local address.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.