Hello this post is to introduce Netty, now Netty by definition is: an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers / clients.
Now for you to use Netty means that you need to send object/message/envelop a.k.a "entity" from one place to another via network so you have a client/server model where the client send server message or vice verse, or maybe client and server "exchange" messages etc....
now to be specific this tutorial/example is about a very simple client/server example where client send server a message and server reply back.
So let the code begin, first we need to define the client the client is a class that start to connect to given port nothing really tricky just configuration code and few lines to initialize connection same old story
now to be specific this tutorial/example is about a very simple client/server example where client send server a message and server reply back.
So let the code begin, first we need to define the client the client is a class that start to connect to given port nothing really tricky just configuration code and few lines to initialize connection same old story
Client:
Well in the server is almost the same a Channel, Bootstrap the same components.
Server
Netty is all about Handlers and Handler implementation. now why handlers are Important well in a nutshell handlers from the name handles the data so if you're sending some sort of data to a server your handler handles how your data is going to be transformed, what are you going to do with data you have if you really want to understand the Handlers in Netty these are two couple of sources you really would like to read:
http://seeallhearall.blogspot.com/2012/05/netty-tutorial-part-1-introduction-to.html
http://docs.jboss.org/netty/3.1/guide/html/start.html
Server Handler
Client Handler
Server Run
Client Run
No comments:
Post a Comment