Basic questions realted to Netty usage
Bruno de Carvalho
kindernade at gmail.com
Sat Jul 31 15:25:53 EDT 2010
Kanksha,
Regarding your 1) question, I believe it is. I'd just advise you to add
the channels to the channel groups as soon as they are connected and not
only after SSL handshake completing.
About your point 2) really depends on whether you want to maintain
context/state per client. From what I understood, your architecture goes
like this.
client --> server --> processing module --> server --> client
Since you don't want to mix up responses to clients, I guess in your
case a server handler per channel would be more appropriate. Let me
elaborate:
With one handler per channel:
client1 -> srv[handler1] -> ProcMod -> srv[handler1] -> client1
client2 -> srv[handler2] -> ProcMod -> srv[handler2] -> client2
With the same handler for all channels:
client1 -> srv-handler -> ProcMod -> srv-handler -> 1 or 2?
client2 -> srv-handler -> ProcMod -> srv-handler -> 1 or 2?
Bruno
On Sat, 2010-07-31 at 03:36 -0700, Kanksha wrote:
> Hi
>
> I am new to Java and NIO socket in java. I need to use netty for
> establishing the client-server communication in an application which would
> have multiple clients sending connection requests to the Server
> Simultaneously. Also, I need to establish SSL communication. After receiving
> the request from the client, the server will forward the message to another
> module which will do processing and send response o server. The server will
> now fwd this response back to the respective client.
>
> After going through the examples Discard server and Secure chat client, I
> have the following understanding:
>
> For solving my purpose; At the server end I will have to write
> 1)Server class
> 2)PipelieneFactory class
> 3)ServerHandler extending SimpleChannelHandler and containing a static
> DefaultChannelGroup channels
>
> Flow:
>
> Client 1 sends a request – after successful SSL handshake the channel is
> added to channels
> Client 2 sends a request - after successful SSL handshake the channel is
> added to and so on.
> Now the specific respective channels will be used to communicate with the
> server until a terminate request is sent.
>
>
> I have the following query here :
> 1)Is this understanding correct?
> 2)Should I be using the different channel handler for each channel or
> single channel handler solve my purpose.
>
>
> Thanks in advance.
>
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Basic-questions-realted-to-Netty-usage-tp5358044p5358044.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
More information about the netty-users
mailing list