You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2011/12/01 21:31:46 UTC
[MINA 3] IoSession
Hi,
as I'm trying to implement the SSL layer, I have some suggestion
regarding the IoSession.
Right now, the session is navigating through different states :
CREATED, CONNECTED, CLOSING, CLOSED
I have added two more states :
SECURING, SECURED
The possible transition are :
o--> CREATED
CREATED --> CONNECTED, CLOSING, SECURING
CONNECTED --> CLOSING
CLOSING --> CLOSED
CLOSED --o
SECURING --> SECURED, CLOSING
SECURED --> CLOSING
At first it seems enough, but when it comes to deal with TLS, we may
need to switch from a CONNECTED state to a SECURING state, and the very
same for SECURED --> CONNECTED. That adds two more transitions :
CONNECTED --> SECURING
SECURED --> CONNECTED
We could also add an IDLE and an IDLE_SECURED states, to manage idle
sessions. That's 6 more transitions :
CONNECTED --> IDLE
SECURED --> IDLE_SECURED
IDLE --> CONNECTED, CLOSING
IDLE_SECURED --> SECURED, CLOSING
We could even think about two other possible transitions, to deal with a
switch from an idle session to a secured session (or the same for a
secure idle session) :
IDLE --> SECURING
IDLE_SECURED --> CONNECTED
So here is the full transition table :
o--> CREATED
CREATED --> CONNECTED, CLOSING, SECURING
CONNECTED --> CLOSING, SECURING, IDLE
CLOSING --> CLOSED
CLOSED --o
SECURING --> SECURED, CLOSING
SECURED --> CLOSING, CONNECTED, IDLE_SECURED
IDLE --> CONNECTED, CLOSING, SECURING
IDLE_SECURED --> SECURED, CLOSING, CONNECTED
I'm over the roof ?
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: [MINA 3] IoSession
Posted by Emmanuel Lecharny <el...@gmail.com>.
On 12/1/11 9:37 PM, Kiran Ayyagari wrote:
> On Thu, Dec 1, 2011 at 3:31 PM, Emmanuel Lecharny<el...@gmail.com> wrote:
>> Hi,
>>
>> as I'm trying to implement the SSL layer, I have some suggestion regarding
>> the IoSession.
>>
>> Right now, the session is navigating through different states :
>> CREATED, CONNECTED, CLOSING, CLOSED
>>
>> I have added two more states :
>> SECURING, SECURED
>>
>> The possible transition are :
>>
>> o--> CREATED
>> CREATED --> CONNECTED, CLOSING, SECURING
>> CONNECTED --> CLOSING
>> CLOSING --> CLOSED
>> CLOSED --o
>> SECURING --> SECURED, CLOSING
>> SECURED --> CLOSING
>>
>> At first it seems enough, but when it comes to deal with TLS, we may need to
>> switch from a CONNECTED state to a SECURING state, and the very same for
>> SECURED --> CONNECTED. That adds two more transitions :
>> CONNECTED --> SECURING
>> SECURED --> CONNECTED
>>
>> We could also add an IDLE and an IDLE_SECURED states, to manage idle
>> sessions. That's 6 more transitions :
>> CONNECTED --> IDLE
>> SECURED --> IDLE_SECURED
>> IDLE --> CONNECTED, CLOSING
>> IDLE_SECURED --> SECURED, CLOSING
>>
>> We could even think about two other possible transitions, to deal with a
>> switch from an idle session to a secured session (or the same for a secure
>> idle session) :
>> IDLE --> SECURING
>> IDLE_SECURED --> CONNECTED
>>
> if there is some processing(here securing/handshake) going on can that
> session still be considered as in IDLE state?
> (IMO not)
No, it will transit from IDLE to CONNECTED.
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: [MINA 3] IoSession
Posted by Kiran Ayyagari <ka...@apache.org>.
On Thu, Dec 1, 2011 at 3:31 PM, Emmanuel Lecharny <el...@gmail.com> wrote:
> Hi,
>
> as I'm trying to implement the SSL layer, I have some suggestion regarding
> the IoSession.
>
> Right now, the session is navigating through different states :
> CREATED, CONNECTED, CLOSING, CLOSED
>
> I have added two more states :
> SECURING, SECURED
>
> The possible transition are :
>
> o--> CREATED
> CREATED --> CONNECTED, CLOSING, SECURING
> CONNECTED --> CLOSING
> CLOSING --> CLOSED
> CLOSED --o
> SECURING --> SECURED, CLOSING
> SECURED --> CLOSING
>
> At first it seems enough, but when it comes to deal with TLS, we may need to
> switch from a CONNECTED state to a SECURING state, and the very same for
> SECURED --> CONNECTED. That adds two more transitions :
> CONNECTED --> SECURING
> SECURED --> CONNECTED
>
> We could also add an IDLE and an IDLE_SECURED states, to manage idle
> sessions. That's 6 more transitions :
> CONNECTED --> IDLE
> SECURED --> IDLE_SECURED
> IDLE --> CONNECTED, CLOSING
> IDLE_SECURED --> SECURED, CLOSING
>
> We could even think about two other possible transitions, to deal with a
> switch from an idle session to a secured session (or the same for a secure
> idle session) :
> IDLE --> SECURING
> IDLE_SECURED --> CONNECTED
>
if there is some processing(here securing/handshake) going on can that
session still be considered as in IDLE state?
(IMO not)
> So here is the full transition table :
> o--> CREATED
> CREATED --> CONNECTED, CLOSING, SECURING
> CONNECTED --> CLOSING, SECURING, IDLE
> CLOSING --> CLOSED
> CLOSED --o
> SECURING --> SECURED, CLOSING
> SECURED --> CLOSING, CONNECTED, IDLE_SECURED
> IDLE --> CONNECTED, CLOSING, SECURING
> IDLE_SECURED --> SECURED, CLOSING, CONNECTED
>
> I'm over the roof ?
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
--
Kiran Ayyagari