Structured message reading problem in Netty.

Dai Jun guiwuu at gmail.com
Thu Apr 23 09:06:36 EDT 2009


Hi manishr22,

I am also new to netty and not very sure of my opionion :). By using
pipeline, we should change the ChannelPipeline annotation of
DiscarServerHanlder from all to one, as shown in Timer example in
setion 1.7.2. of user guide.
BTW, would you post these runtime exceptions and client codes? I think
that will be helpful to understand your problem exactly.


On Thu, Apr 23, 2009 at 7:45 PM, manishr22 <manishr22 at gmail.com> wrote:
>
> Hi,
>
> I am new to netty and tried writing netty-server as per my requirement
> seeing various examples. But i am not getting the result correctly.
>
>
> I am trying to write a netty server that can read the that will read the
> message-structre from normal synchronous multi-threaded client ( say 10
> client is sending 1000 messages each ) to the server.
>
>
> By message structure i mean my client is sending the message in the format :
>
>
> [MESSAGE 1-CLIENT 1]    message-length(first 4 byte) header length(next 4
> byte) data (including
>
> header and body as specified bytes of message length and header length)
>
>
> [MESSAGE 2-CLIENT 1]    message-length(first 4 byte) header length(next 4
> byte) data (including
>
> header and body as specified bytes of message length and header length)
>
>
> ........
>
> ........
>
> [MESSAGE 1-CLIENT 2]    message-length(first 4 byte) header length(next 4
> byte) data (including
>
> header and body as specified bytes of message length and header length)
>
>
> [MESSAGE 2-CLIENT 2]    message-length(first 4 byte) header length(next 4
> byte) data (including
>
> header and body as specified bytes of message length and header length)
>
> ....
> .....
>
> [For N number of client and N http://n2.nabble.com/file/n2682454/netty.zip
> netty.zip  number of messages]
>
> and now my netty server should read all the different messages from client/s
> and do the proper message parsing and do some business operation.
>
>
> How i can implement the reading of message-structure using netty.
>
>
> I saw several example and implemented something in it. but its not giving
> the appropriate result rather i am getting exception all the time.
>
> The basic source code which i tried for this is also attached for reference.
>
> Any suggestion and help with some sample code will be really appreciated.
>
>
> Regards
>
> Manish
>
>
>
> --
> View this message in context: http://n2.nabble.com/Structured-message-reading-problem-in-Netty.-tp2682454p2682454.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>



-- 
Best regards,

Dai Jun or Danny Dai in english, http://guiwuu.googlepages.com
GTalk: guiwuu at gmail.com | QQ: 93409048 | MSN: guiwuu at hotmail.com |
Twitter: guiwuu




More information about the netty-users mailing list