You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Dhruv Chopra <dh...@shephertz.co.in> on 2012/09/16 18:26:35 UTC

websocket codec for MINA tcp server

Since I didn't hear back for my query from the dev mailing list -
trying the users one to see someone can guide me.

Hi,

We are using Apache Mina for NIO in our gaming server. In our
scenario, the same server must handle data transfer across native
clients (iOS, Android) and web browsers (which are communicating
through websockets).
To do this, we have prototyped an encoder and decoder in the MINA
chain which will do the websocket handshake and manage communication
over WebSocket dataframes (as in RFC 6455).
My question is that is there already a filter for doing this (or one
under development)? If not, we would like to contribute what we have
done to the Apache Mina project and would like to know the process.

Thanks,
Dhruv

Product Site : http://appwarp.shephertz.com/
Company Site : http://shephertz.com/

Re: websocket codec for MINA tcp server

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 9/18/12 9:19 AM, Dhruv Chopra a écrit :
> Thanks Emmanuel, yes I had not subscribed to the dev-mailing list and
> missed your replies :-)
>
> Great - currently we are working on completing the codec in a way that
> it can be chained with other filters and having some issues.
>
> I read that when chaining encoders together (say A and B), the output
> of encoder A must NOT be an iobuffer for encoder B to get a chance at
> encoding it further. To debug our issue we are just trying to chain a
> simple pass-through filter to our custom protocol one. I see that the
> message is sent fine from Encoder A (write object)->Encoder B (write
> iobuffer) ->client - but the session is getting closed immediately
> afterwards. Below is the mina server call stack. Any idea on what we
> could be doing wrong?

The stack trace doesn't help : it's just the stack trace you get when 
the session is closed.

The key would be to understand why the sessionClose is generated, and 
it's most certainly due to an exception somewhere.

You may want to add a LogFilter, with some log being generated when an 
exception occurs.
>
> Hidden Source Calls	
> DefaultIoFilterChain$TailFilter.sessionClosed:665	
> DefaultIoFilterChain.callNextSessionClosed:395	
> DefaultIoFilterChain.access$900:46	
> DefaultIoFilterChain$EntryImpl$1.sessionClosed:781	
> ProtocolCodecFilter.sessionClosed:387	
> DefaultIoFilterChain.callNextSessionClosed:395	
> DefaultIoFilterChain.access$900:46	
> DefaultIoFilterChain$EntryImpl$1.sessionClosed:781	
> ProtocolCodecFilter.sessionClosed:387	
> DefaultIoFilterChain.callNextSessionClosed:395	
> DefaultIoFilterChain.access$900:46	
> DefaultIoFilterChain$EntryImpl$1.sessionClosed:781	
> IoFilterEvent.fire:110	
> MdcInjectionFilter.filter:136	
> CommonEventFilter.sessionClosed:55	
> DefaultIoFilterChain.callNextSessionClosed:395	
> DefaultIoFilterChain.access$900:46	
> DefaultIoFilterChain$EntryImpl$1.sessionClosed:781	
> IoFilterAdapter.sessionClosed:95	
> DefaultIoFilterChain.callNextSessionClosed:395	
> DefaultIoFilterChain.fireSessionClosed:388	
> IoServiceListenerSupport.fireSessionDestroyed:244	
> AbstractPollingIoProcessor.removeNow:602	
> AbstractPollingIoProcessor.removeSessions:562	
> AbstractPollingIoProcessor.access$800:68	
> AbstractPollingIoProcessor$Processor.run:1149	
> NamePreservingRunnable.run:64	
>
>
> On Mon, Sep 17, 2012 at 12:34 AM, Emmanuel Lecharny
> <el...@apache.org> wrote:
>> Hi,
>>
>> May be you aren't subscribed to the MINA dev list ? Three of us have already
>> replied to your mail (see below for the replies)
>>
>> Base line : yes we would be very pleased to get such a contribution !
>>
>>
>> http://mail-archives.apache.org/mod_mbox/mina-dev/201209.mbox/%3CCA++geaD2k=Hg1RL+oVDvdtE-KNAAt85U81_Xp=8oiPEr4bWmsQ@mail.gmail.com%3E
>>
>> http://mail-archives.apache.org/mod_mbox/mina-dev/201209.mbox/%3CCAFk14gvnN3fsRer+hQyG08yOFXsC-TTq8LOq6LZv4+_4yURxFw@mail.gmail.com%3E
>>
>> http://mail-archives.apache.org/mod_mbox/mina-dev/201209.mbox/%3C50518475.7040205@gmail.com%3E
>>
>>
>> On Sun, Sep 16, 2012 at 6:26 PM, Dhruv Chopra <dh...@shephertz.co.in>
>> wrote:
>>> Since I didn't hear back for my query from the dev mailing list -
>>> trying the users one to see someone can guide me.
>>>
>>> Hi,
>>>
>>> We are using Apache Mina for NIO in our gaming server. In our
>>> scenario, the same server must handle data transfer across native
>>> clients (iOS, Android) and web browsers (which are communicating
>>> through websockets).
>>> To do this, we have prototyped an encoder and decoder in the MINA
>>> chain which will do the websocket handshake and manage communication
>>> over WebSocket dataframes (as in RFC 6455).
>>> My question is that is there already a filter for doing this (or one
>>> under development)? If not, we would like to contribute what we have
>>> done to the Apache Mina project and would like to know the process.
>>>
>>> Thanks,
>>> Dhruv
>>>
>>> Product Site : http://appwarp.shephertz.com/
>>> Company Site : http://shephertz.com/
>>
>>
>>
>> --
>> Regards,
>> Cordialement,
>> Emmanuel Lécharny
>> www.iktek.com


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: websocket codec for MINA tcp server

Posted by Dhruv Chopra <dh...@shephertz.co.in>.
Thanks Emmanuel, yes I had not subscribed to the dev-mailing list and
missed your replies :-)

Great - currently we are working on completing the codec in a way that
it can be chained with other filters and having some issues.

I read that when chaining encoders together (say A and B), the output
of encoder A must NOT be an iobuffer for encoder B to get a chance at
encoding it further. To debug our issue we are just trying to chain a
simple pass-through filter to our custom protocol one. I see that the
message is sent fine from Encoder A (write object)->Encoder B (write
iobuffer) ->client - but the session is getting closed immediately
afterwards. Below is the mina server call stack. Any idea on what we
could be doing wrong?

Hidden Source Calls	
DefaultIoFilterChain$TailFilter.sessionClosed:665	
DefaultIoFilterChain.callNextSessionClosed:395	
DefaultIoFilterChain.access$900:46	
DefaultIoFilterChain$EntryImpl$1.sessionClosed:781	
ProtocolCodecFilter.sessionClosed:387	
DefaultIoFilterChain.callNextSessionClosed:395	
DefaultIoFilterChain.access$900:46	
DefaultIoFilterChain$EntryImpl$1.sessionClosed:781	
ProtocolCodecFilter.sessionClosed:387	
DefaultIoFilterChain.callNextSessionClosed:395	
DefaultIoFilterChain.access$900:46	
DefaultIoFilterChain$EntryImpl$1.sessionClosed:781	
IoFilterEvent.fire:110	
MdcInjectionFilter.filter:136	
CommonEventFilter.sessionClosed:55	
DefaultIoFilterChain.callNextSessionClosed:395	
DefaultIoFilterChain.access$900:46	
DefaultIoFilterChain$EntryImpl$1.sessionClosed:781	
IoFilterAdapter.sessionClosed:95	
DefaultIoFilterChain.callNextSessionClosed:395	
DefaultIoFilterChain.fireSessionClosed:388	
IoServiceListenerSupport.fireSessionDestroyed:244	
AbstractPollingIoProcessor.removeNow:602	
AbstractPollingIoProcessor.removeSessions:562	
AbstractPollingIoProcessor.access$800:68	
AbstractPollingIoProcessor$Processor.run:1149	
NamePreservingRunnable.run:64	


On Mon, Sep 17, 2012 at 12:34 AM, Emmanuel Lecharny
<el...@apache.org> wrote:
>
> Hi,
>
> May be you aren't subscribed to the MINA dev list ? Three of us have already
> replied to your mail (see below for the replies)
>
> Base line : yes we would be very pleased to get such a contribution !
>
>
> http://mail-archives.apache.org/mod_mbox/mina-dev/201209.mbox/%3CCA++geaD2k=Hg1RL+oVDvdtE-KNAAt85U81_Xp=8oiPEr4bWmsQ@mail.gmail.com%3E
>
> http://mail-archives.apache.org/mod_mbox/mina-dev/201209.mbox/%3CCAFk14gvnN3fsRer+hQyG08yOFXsC-TTq8LOq6LZv4+_4yURxFw@mail.gmail.com%3E
>
> http://mail-archives.apache.org/mod_mbox/mina-dev/201209.mbox/%3C50518475.7040205@gmail.com%3E
>
>
> On Sun, Sep 16, 2012 at 6:26 PM, Dhruv Chopra <dh...@shephertz.co.in>
> wrote:
>>
>> Since I didn't hear back for my query from the dev mailing list -
>> trying the users one to see someone can guide me.
>>
>> Hi,
>>
>> We are using Apache Mina for NIO in our gaming server. In our
>> scenario, the same server must handle data transfer across native
>> clients (iOS, Android) and web browsers (which are communicating
>> through websockets).
>> To do this, we have prototyped an encoder and decoder in the MINA
>> chain which will do the websocket handshake and manage communication
>> over WebSocket dataframes (as in RFC 6455).
>> My question is that is there already a filter for doing this (or one
>> under development)? If not, we would like to contribute what we have
>> done to the Apache Mina project and would like to know the process.
>>
>> Thanks,
>> Dhruv
>>
>> Product Site : http://appwarp.shephertz.com/
>> Company Site : http://shephertz.com/
>
>
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com

Re: websocket codec for MINA tcp server

Posted by Emmanuel Lecharny <el...@apache.org>.
Hi,

May be you aren't subscribed to the MINA dev list ? Three of us have
already replied to your mail (see below for the replies)

Base line : yes we would be very pleased to get such a contribution !


http://mail-archives.apache.org/mod_mbox/mina-dev/201209.mbox/%3CCA++geaD2k=Hg1RL+oVDvdtE-KNAAt85U81_Xp=8oiPEr4bWmsQ@mail.gmail.com%3E

http://mail-archives.apache.org/mod_mbox/mina-dev/201209.mbox/%3CCAFk14gvnN3fsRer+hQyG08yOFXsC-TTq8LOq6LZv4+_4yURxFw@mail.gmail.com%3E

http://mail-archives.apache.org/mod_mbox/mina-dev/201209.mbox/%3C50518475.7040205@gmail.com%3E

On Sun, Sep 16, 2012 at 6:26 PM, Dhruv Chopra
<dh...@shephertz.co.in>wrote:

> Since I didn't hear back for my query from the dev mailing list -
> trying the users one to see someone can guide me.
>
> Hi,
>
> We are using Apache Mina for NIO in our gaming server. In our
> scenario, the same server must handle data transfer across native
> clients (iOS, Android) and web browsers (which are communicating
> through websockets).
> To do this, we have prototyped an encoder and decoder in the MINA
> chain which will do the websocket handshake and manage communication
> over WebSocket dataframes (as in RFC 6455).
> My question is that is there already a filter for doing this (or one
> under development)? If not, we would like to contribute what we have
> done to the Apache Mina project and would like to know the process.
>
> Thanks,
> Dhruv
>
> Product Site : http://appwarp.shephertz.com/
> Company Site : http://shephertz.com/
>



-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com