You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Germán Borbolla Flores <gb...@insys-corp.com.mx> on 2007/07/26 18:39:44 UTC

Difference between sessionOpened and sessionCreated

Hi,

As part of a server I'm working on I need to filter incoming connection 
based in a number of criteria.

I don't know where to put it, in IoFilter.sessionCreated or in 
IoFilter.sessionOpened, I've checked BlacklistFilter and the connection 
is validated in both methods, do I have to this?

For future reference, which method is first called?

Thanks,

Germán

Re: Difference between sessionOpened and sessionCreated

Posted by Germán Borbolla Flores <gb...@insys-corp.com.mx>.
Thanks for all your help.

I will follow the same rules that BlacklistFilter uses, so I avoid the 
problem where the session is not blocked on time.

Maarten Bosteels wrote:
> I finally found the thread I was looking for:
>
> http://mail-archives.apache.org/mod_mbox/directory-dev/200511.mbox/%3c43
> 6924F2.7010005@trillian.se%3e
>
> Maarten
>
> On 7/26/07, Germán Borbolla Flores <gb...@insys-corp.com.mx> wrote:
>   
>> Thanks, I will try filterin on sessionCreated. I'll post my result.
>>
>> Maarten Bosteels wrote:
>>     
>>> see also http://issues.apache.org/jira/browse/DIRMINA-108
>>>
>>> On 7/26/07, Maarten Bosteels <mb...@gmail.com> wrote:
>>>
>>>       
>>>> see javadoc:
>>>>
>>>>
>>>>         
> http://mina.apache.org/report/1.1/apidocs/org/apache/mina/common/IoHandl
>   
>>> er.html#sessionCreated(org.apache.mina.common.IoSession)
>>>
>>>       
> <http://mina.apache.org/report/1.1/apidocs/org/apache/mina/common/IoHand
>   
>>> ler.html#sessionCreated%28org.apache.mina.common.IoSession%29>
>>>
>>>       
>>>> sessionCreated:
>>>> Invoked when the session is created. Initialize default socket
>>>>
>>>>         
>>> parameters
>>>
>>>       
>>>> and user-defined attributes here.
>>>>
>>>> sessionOpened:
>>>> Invoked when the connection is opened. This method is not invoked
>>>>         
> if
>   
>>> the
>>>
>>>       
>>>> transport type is UDP.
>>>>
>>>> Maarten
>>>>
>>>> On 7/26/07, Germán Borbolla Flores <gborbolla@insys-corp.com.mx >
>>>>
>>>>         
>>> wrote:
>>>
>>>       
>>>>> Hi,
>>>>>
>>>>> As part of a server I'm working on I need to filter incoming
>>>>>
>>>>>           
>>> connection
>>>
>>>       
>>>>> based in a number of criteria.
>>>>>
>>>>> I don't know where to put it, in IoFilter.sessionCreated or in
>>>>> IoFilter.sessionOpened, I've checked BlacklistFilter and the
>>>>>
>>>>>           
>>> connection
>>>
>>>       
>>>>> is validated in both methods, do I have to this?
>>>>>
>>>>> For future reference, which method is first called?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Germán
>>>>>
>>>>>
>>>>>           

Re: Difference between sessionOpened and sessionCreated

Posted by Maarten Bosteels <mb...@gmail.com>.
I finally found the thread I was looking for:

http://mail-archives.apache.org/mod_mbox/directory-dev/200511.mbox/%3c436924F2.7010005@trillian.se%3e

Maarten

On 7/26/07, Germán Borbolla Flores <gb...@insys-corp.com.mx> wrote:
>
> Thanks, I will try filterin on sessionCreated. I'll post my result.
>
> Maarten Bosteels wrote:
> > see also http://issues.apache.org/jira/browse/DIRMINA-108
> >
> > On 7/26/07, Maarten Bosteels <mb...@gmail.com> wrote:
> >
> >> see javadoc:
> >>
> >>
> > http://mina.apache.org/report/1.1/apidocs/org/apache/mina/common/IoHandl
> > er.html#sessionCreated(org.apache.mina.common.IoSession)
> >
> >>
> > <http://mina.apache.org/report/1.1/apidocs/org/apache/mina/common/IoHand
> > ler.html#sessionCreated%28org.apache.mina.common.IoSession%29>
> >
> >> sessionCreated:
> >> Invoked when the session is created. Initialize default socket
> >>
> > parameters
> >
> >> and user-defined attributes here.
> >>
> >> sessionOpened:
> >> Invoked when the connection is opened. This method is not invoked if
> >>
> > the
> >
> >> transport type is UDP.
> >>
> >> Maarten
> >>
> >> On 7/26/07, Germán Borbolla Flores <gborbolla@insys-corp.com.mx >
> >>
> > wrote:
> >
> >>> Hi,
> >>>
> >>> As part of a server I'm working on I need to filter incoming
> >>>
> > connection
> >
> >>> based in a number of criteria.
> >>>
> >>> I don't know where to put it, in IoFilter.sessionCreated or in
> >>> IoFilter.sessionOpened, I've checked BlacklistFilter and the
> >>>
> > connection
> >
> >>> is validated in both methods, do I have to this?
> >>>
> >>> For future reference, which method is first called?
> >>>
> >>> Thanks,
> >>>
> >>> Germán
> >>>
> >>>
> >>
>

Re: Difference between sessionOpened and sessionCreated

Posted by Germán Borbolla Flores <gb...@insys-corp.com.mx>.
Thanks, I will try filterin on sessionCreated. I'll post my result.

Maarten Bosteels wrote:
> see also http://issues.apache.org/jira/browse/DIRMINA-108
>
> On 7/26/07, Maarten Bosteels <mb...@gmail.com> wrote:
>   
>> see javadoc:
>>
>>     
> http://mina.apache.org/report/1.1/apidocs/org/apache/mina/common/IoHandl
> er.html#sessionCreated(org.apache.mina.common.IoSession)
>   
>>     
> <http://mina.apache.org/report/1.1/apidocs/org/apache/mina/common/IoHand
> ler.html#sessionCreated%28org.apache.mina.common.IoSession%29>
>   
>> sessionCreated:
>> Invoked when the session is created. Initialize default socket
>>     
> parameters
>   
>> and user-defined attributes here.
>>
>> sessionOpened:
>> Invoked when the connection is opened. This method is not invoked if
>>     
> the
>   
>> transport type is UDP.
>>
>> Maarten
>>
>> On 7/26/07, Germán Borbolla Flores <gborbolla@insys-corp.com.mx >
>>     
> wrote:
>   
>>> Hi,
>>>
>>> As part of a server I'm working on I need to filter incoming
>>>       
> connection
>   
>>> based in a number of criteria.
>>>
>>> I don't know where to put it, in IoFilter.sessionCreated or in
>>> IoFilter.sessionOpened, I've checked BlacklistFilter and the
>>>       
> connection
>   
>>> is validated in both methods, do I have to this?
>>>
>>> For future reference, which method is first called?
>>>
>>> Thanks,
>>>
>>> Germán
>>>
>>>       
>>     

Re: Difference between sessionOpened and sessionCreated

Posted by Maarten Bosteels <mb...@gmail.com>.
see also http://issues.apache.org/jira/browse/DIRMINA-108

On 7/26/07, Maarten Bosteels <mb...@gmail.com> wrote:
>
> see javadoc:
> http://mina.apache.org/report/1.1/apidocs/org/apache/mina/common/IoHandler.html#sessionCreated(org.apache.mina.common.IoSession)
>
> <http://mina.apache.org/report/1.1/apidocs/org/apache/mina/common/IoHandler.html#sessionCreated%28org.apache.mina.common.IoSession%29>
>
> sessionCreated:
> Invoked when the session is created. Initialize default socket parameters
> and user-defined attributes here.
>
> sessionOpened:
> Invoked when the connection is opened. This method is not invoked if the
> transport type is UDP.
>
> Maarten
>
> On 7/26/07, Germán Borbolla Flores <gborbolla@insys-corp.com.mx > wrote:
> >
> > Hi,
> >
> > As part of a server I'm working on I need to filter incoming connection
> > based in a number of criteria.
> >
> > I don't know where to put it, in IoFilter.sessionCreated or in
> > IoFilter.sessionOpened, I've checked BlacklistFilter and the connection
> > is validated in both methods, do I have to this?
> >
> > For future reference, which method is first called?
> >
> > Thanks,
> >
> > Germán
> >
>
>

Re: Difference between sessionOpened and sessionCreated

Posted by Maarten Bosteels <mb...@gmail.com>.
see javadoc:
http://mina.apache.org/report/1.1/apidocs/org/apache/mina/common/IoHandler.html#sessionCreated(org.apache.mina.common.IoSession)

sessionCreated:
Invoked when the session is created. Initialize default socket parameters
and user-defined attributes here.

sessionOpened:
Invoked when the connection is opened. This method is not invoked if the
transport type is UDP.

Maarten

On 7/26/07, Germán Borbolla Flores <gb...@insys-corp.com.mx> wrote:
>
> Hi,
>
> As part of a server I'm working on I need to filter incoming connection
> based in a number of criteria.
>
> I don't know where to put it, in IoFilter.sessionCreated or in
> IoFilter.sessionOpened, I've checked BlacklistFilter and the connection
> is validated in both methods, do I have to this?
>
> For future reference, which method is first called?
>
> Thanks,
>
> Germán
>