简体   繁体   中英

How to send an object with Netty?

How to send bean from server side and receive this bean in the client side by Netty? When I send simple integer message, inputstream, it works successfully but I need to send bean.

If you are using netty at client and server side then you can use the Netty ObjectDecoder and ObjectEncoder in your ChannelPipeline to send and receive objects.

Take a look at the netty ping pong example which does this. The code is bit out of date, but you will get the general idea on working with objects.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM