IIRC, there's a JIRA issue related with reconnection.  Why don't we continue
the discussion there to keep our context more straightforward?  I want to
give you the exact URL right now, but JIRA is down unfortunately.  Let's
check back when it's up again, and post each other's idea before
implementing it, especially when this is the case that can affect the API.

Trustin


On 7/21/06, Rob Butler <[EMAIL PROTECTED]> wrote:



--- Julien Vermillard <[EMAIL PROTECTED]> wrote:

> Hi,
>
> After talking with Peter I'm trying to add
> reconnection features to
> sockets. It's in the form of a reconnection() method
> in SocketConnector
> for recycling a closed IoSession. It's a bit tricky
> but look like
> working.
>
> My last problem is why when the session is closed
> the filter chain is
> cleared ? Because it preventing me to keep the
> inited filterchain after
> a reconnection.
>
> Some solutions :
>  - remove the "session.getFilterChain().clear();"
> when the session is
> closed

I would think this is more valid.

>  - recall IoHandler.sessionCreated(...) when a
> session is reconnected.
> normaly it will recreate the filterchain because
> it's where everybody
> puut the filter creation code.

This is not necessarily true.  It may be common
practice (and probably a bad one) but it is by no
means required.  I plan on using the various config
API's to setup everything outside the IoHandler.

In my opinion (and I could be wrong, but it is my
opinion) everything should be setup and ready to go
before a client ever connects to the server.  The only
time you should modify the filter chain is if your
implementing something like startTLS or similar.

>
> The last solution can be confusing because a session
> can be created
> multiple time..

Yes, I would think it is confusing, and possibly wrong
simply if you think about when reconnect is called.
Reconnect is called when the client/server wishes to
reestablish a connection to the remote end.  Your
probably doing this because you were in the middle of
something and lost the connection.  If your not
creating an entirely new Iosession object then your
not really initiating a new session, your
re-establishing communication.  Thus, sessionCreated
probably shouldn't be called.

Just my opinion.
Rob

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com




--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Reply via email to