Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimal netty jar for applet client

Tags:

netty

I am using Netty for some server side components for a while now and I am really pleased with it. Thus I'd also like to use it on the client side for my own convenience, but I want to keep the footprint of the applet (in this case) as small as possible. All I need from Netty there is:

  • Simple string based protocol (stringdecoder, stringencoder, framer...)
  • Plus: Datagram support

I already took a look at the jar but it seems that I can't get it to the absolute minimum possible because I am not deep enough in the Netty sources.

It would be great if anyone familar with Netty's internals could assist me with an answer on building a minimal jar. Thanks!

like image 276
dcode Avatar asked Nov 13 '22 07:11

dcode


1 Answers

So a good first start is to use Netty 4+ where the protocol-specific codebase got nicely organised.

Second, try just including netty-common plus whichever codec you need (typically HTTP). Also if you're optimising for compiled size, try using ProGuard. For simple UDP-oriented applications, you shouldn't need anything else.

HTH

like image 105
Chris Mowforth Avatar answered Dec 04 '22 14:12

Chris Mowforth