Le 24/10/16 à 19:24, Murty Devarakonda a écrit :
> I did read that section to see where things may be going wrong and didn't see
> anything that's different than what we are doing.
>
> Now, to explain a bit about our project, so far the MINA server is listening
> on one port and protocol encoder and decoder seems to be working fine.
>
> Recently we changed this model so that our MINA server will start listening
> on two ports one for the old way or reading client requests and the new one
> for parsing the client data (using the protocol decoder and storing the same
> in the MINA session) before the client request is handed over to the MINA
> server.  
>
> In this new flow, I see that the ProtocolDecoder where I introduced the
> parsing of the client request to store few pieces of data in the MINA
> session is working fine.  And I could see that the request is successfully
> being processed and required response being generated. 
>
> The problem is, I don't see that the data that's getting written into the
> MINA write queue is being handed over to the ProtocolEncoder and the
> response reached the client successfully.
>
> One question to you is, is starting MINA to accept client connections on two
> ports wrong?  
No, it should work fine.

> So I don't think that's anything wrong after going through the
> MINA documentation.  So currently I have two of the independent:
>
> 1)  NioSocketAcceptors binding to two different ports
> 2) Two independent filter chains to support rules on the two different
> accepting ports
> 3) As part of the filters, two independent ProtocolCodecFactories that have
> their own ProtocolEncoder and ProtocolDecoder implementations.
>
> Do you think MINA server will not be able to process sessions that are bound
> to two different ports?

A session is created when a new client connect to the server. It's
unrelated to the fact they are bound to different port.

What is puzling is that the decoder is bing called, but not the encoder.
You should go through the codec filter when doing asession.write, but
again, I don't have yoru code under my eyes, so I can't teel you what
you are doing wrong...

-- 
Emmanuel Lecharny

Symas.com
directory.apache.org

Reply via email to