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 <tr...@gmail.com> on 2007/11/28 16:05:21 UTC
Feed back wanted: Allowing a user to change the local addresses of an acceptor.
Hi community,
Currently, MINA 2.0.0-M1-SNAPSHOT doesn't allow a user to call
setLocalAddresses() after IoAcceptor.bind() is called. To change the
local addresses, a user have to unbind, change the localAddresses
property and bind again, which is not very convenient and causes
interruption of service.
MINA 1.x doesn't have this problem because user always specify the
local address and the IoHandler for each bind() call and the local
address for each unbind() (or unbindAll()).
However, considering an IoService is a logical group of managed
sessions with the same business logic, specifying IoHandler for every
bind() call doesn't make sense. That's why we removed handler
parameter from bind() method. One mistake I've made at the moment of
the change is that I also removed the local address parameter from the
bind() method. I'd like to know what change do you prefer. Let me
list my idea:
1) Change localAddress(es) to represent the list of the currently
bound addresses. Add defaultLocalAddress(es) property, which is used
when bind() method is called with no parameter. Also add
bind(localAddress), unbind(localAddress) and unbindAll() methods.
2) Retain the current trunk API and let setLocalAddresses() method
decide what address to bind and what address to unbind.
I think the first solution is better because A) it resembles the 1.x
API, 2) is easy to understand and 3) IoConnector already has the
similar API design:
* http://mina.apache.org/report/trunk/apidocs/org/apache/mina/common/IoConnector.html
(defaultRemoteAddress)
What do you think about the suggested changes? Any feed back or whole
new idea is appreciated. If there's no objection within next 72
hours, I will execute the idea #1.
Thank in advance,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: Feed back wanted: Allowing a user to change the local addresses of an acceptor.
Posted by Maarten Bosteels <mb...@gmail.com>.
+1 for idea #1
On Nov 28, 2007 4:05 PM, Trustin Lee <tr...@gmail.com> wrote:
> Hi community,
>
> Currently, MINA 2.0.0-M1-SNAPSHOT doesn't allow a user to call
> setLocalAddresses() after IoAcceptor.bind() is called. To change the
> local addresses, a user have to unbind, change the localAddresses
> property and bind again, which is not very convenient and causes
> interruption of service.
>
> MINA 1.x doesn't have this problem because user always specify the
> local address and the IoHandler for each bind() call and the local
> address for each unbind() (or unbindAll()).
>
> However, considering an IoService is a logical group of managed
> sessions with the same business logic, specifying IoHandler for every
> bind() call doesn't make sense. That's why we removed handler
> parameter from bind() method. One mistake I've made at the moment of
> the change is that I also removed the local address parameter from the
> bind() method. I'd like to know what change do you prefer. Let me
> list my idea:
>
> 1) Change localAddress(es) to represent the list of the currently
> bound addresses. Add defaultLocalAddress(es) property, which is used
> when bind() method is called with no parameter. Also add
> bind(localAddress), unbind(localAddress) and unbindAll() methods.
>
> 2) Retain the current trunk API and let setLocalAddresses() method
> decide what address to bind and what address to unbind.
>
> I think the first solution is better because A) it resembles the 1.x
> API, 2) is easy to understand and 3) IoConnector already has the
> similar API design:
> * http://mina.apache.org/report/trunk/apidocs/org/apache/mina/common/IoConnector.html
> (defaultRemoteAddress)
>
> What do you think about the suggested changes? Any feed back or whole
> new idea is appreciated. If there's no objection within next 72
> hours, I will execute the idea #1.
>
> Thank in advance,
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
Re: Feed back wanted: Allowing a user to change the local addresses of an acceptor.
Posted by Mark <el...@gmail.com>.
#1 for me...
> Trustin Lee wrote:
> > Hi community,
> >
> > Currently, MINA 2.0.0-M1-SNAPSHOT doesn't allow a user to call
> > setLocalAddresses() after IoAcceptor.bind() is called. To change the
> > local addresses, a user have to unbind, change the localAddresses
> > property and bind again, which is not very convenient and causes
> > interruption of service.
> >
> > MINA 1.x doesn't have this problem because user always specify the
> > local address and the IoHandler for each bind() call and the local
> > address for each unbind() (or unbindAll()).
> >
> > However, considering an IoService is a logical group of managed
> > sessions with the same business logic, specifying IoHandler for every
> > bind() call doesn't make sense. That's why we removed handler
> > parameter from bind() method. One mistake I've made at the moment of
> > the change is that I also removed the local address parameter from the
> > bind() method. I'd like to know what change do you prefer. Let me
> > list my idea:
> >
> > 1) Change localAddress(es) to represent the list of the currently
> > bound addresses. Add defaultLocalAddress(es) property, which is used
> > when bind() method is called with no parameter. Also add
> > bind(localAddress), unbind(localAddress) and unbindAll() methods.
> >
> > 2) Retain the current trunk API and let setLocalAddresses() method
> > decide what address to bind and what address to unbind.
> >
> > I think the first solution is better because A) it resembles the 1.x
> > API, 2) is easy to understand and 3) IoConnector already has the
> > similar API design:
> > *
> http://mina.apache.org/report/trunk/apidocs/org/apache/mina/common/IoConnector.html
> > (defaultRemoteAddress)
> >
> > What do you think about the suggested changes? Any feed back or whole
> > new idea is appreciated. If there's no objection within next 72
> > hours, I will execute the idea #1.
> >
> > Thank in advance,
> > Trustin
>
>
--
--------------------------------
The adjuration to be "normal" seems shockingly repellent to me; I see
neither hope nor comfort in sinking to that low level. I think it is
ignorance that makes people think of abnormality only with horror and allows
them to remain undismayed at the proximity of "normal" to average and
mediocre. For surely anyone who achieves anything is, essentially, abnormal.
Dr. Karl Menninger
Re: Feed back wanted: Allowing a user to change the local addresses
of an acceptor.
Posted by Mike Heath <mh...@apache.org>.
+1 for #1. I think this option makes the most sense.
-Mike
Trustin Lee wrote:
> Hi community,
>
> Currently, MINA 2.0.0-M1-SNAPSHOT doesn't allow a user to call
> setLocalAddresses() after IoAcceptor.bind() is called. To change the
> local addresses, a user have to unbind, change the localAddresses
> property and bind again, which is not very convenient and causes
> interruption of service.
>
> MINA 1.x doesn't have this problem because user always specify the
> local address and the IoHandler for each bind() call and the local
> address for each unbind() (or unbindAll()).
>
> However, considering an IoService is a logical group of managed
> sessions with the same business logic, specifying IoHandler for every
> bind() call doesn't make sense. That's why we removed handler
> parameter from bind() method. One mistake I've made at the moment of
> the change is that I also removed the local address parameter from the
> bind() method. I'd like to know what change do you prefer. Let me
> list my idea:
>
> 1) Change localAddress(es) to represent the list of the currently
> bound addresses. Add defaultLocalAddress(es) property, which is used
> when bind() method is called with no parameter. Also add
> bind(localAddress), unbind(localAddress) and unbindAll() methods.
>
> 2) Retain the current trunk API and let setLocalAddresses() method
> decide what address to bind and what address to unbind.
>
> I think the first solution is better because A) it resembles the 1.x
> API, 2) is easy to understand and 3) IoConnector already has the
> similar API design:
> * http://mina.apache.org/report/trunk/apidocs/org/apache/mina/common/IoConnector.html
> (defaultRemoteAddress)
>
> What do you think about the suggested changes? Any feed back or whole
> new idea is appreciated. If there's no objection within next 72
> hours, I will execute the idea #1.
>
> Thank in advance,
> Trustin