On Mar 7, 2006, at 1:10 AM, Simon Raess wrote:
On 06.03.2006, at 22:02, peter royal wrote:

On Mar 6, 2006, at 3:49 PM, Simon Raess wrote:
On the client side, it is possible to specify a separate IoHandler for each session. Wouldn't it be more natural to have the possibility to store state in the handler itself? On the server, this would require to have a separate IoHandler for each session. What do you think?

This can certainly be achieved with the current architecture.. What you will want is an IoHandler that creates a delegate every time a new session is established on the server-side, and then the delegate would just forward events as necessary to the delegate.
-pete


Yes, I didn't think about that possibility. But why not have something like the following:

  IoAcceptor acceptor = ...;
  IoHandlerFactory factory = ...;
  acceptor.accept(address, factory);

where IoHandlerFactory is an interface that has the responsibility to create IoHandlers. This factory would be used by the acceptor to create an IoHandler whenever a new session is accepted.

This way, both the client-side and server-side IoHandler could safely use state in instance variables. This seems more consistent to me.

I guess it just depends on what is the more common case. In my experience, I have no problems with everything flowing into a single IoHandler on the server side. So I would want an IoHandlerFactory that just returned the same instance each time. Whichever way it is implemented, I think it would be a valuable contribution to MINA.
-pete

--
[EMAIL PROTECTED] - http://fotap.org/~osi


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to