Typecasting Problem Using Netty and Google Protobuf

Akash Gangil akashg1611 at gmail.com
Mon Jul 25 08:15:20 EDT 2011


Sorry for bothering you guys, found out the problem by myself.
Wasn't initializing the ChannelPipelineFactory correctly, thanks anyways! :)

On Mon, Jul 25, 2011 at 5:08 PM, Akash Gangil <akashg1611 at gmail.com> wrote:

>
>> *EchoServerhandler.java :*
>>
>>  @Override
>>       public void messageReceived(
>>               ChannelHandlerContext ctx, MessageEvent e) {
>>       System.out.print("Message Received : " + e.getMessage());
>>       Packet req = (Packet) e.getMessage();
>>       System.out.print("Packet Id received  :  " + req.getPacketId());
>>       System.out.print("Packet Type received  :  " +
>> req.getPacketType());
>>       System.out.print("Packet Content received  :  " +
>> req.getPacketContent());
>>      }
>>
>>
>>
> Also a system.out.print(e.getMessage()) here gives
> Message Received : BigEndianHeapChannelBuffer(ridx=0, widx=17, cap=17)
> so I guess somehow the decoder is not working.
>
> Though, I have implemented the same message receive logic on the client
> side too,
> and there I am able to receive messages from the server through this
> framework.
>
>
>> --
>>
> Akash
>
>


-- 
Akash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20110725/5d0ccad1/attachment-0001.html 


More information about the netty-users mailing list