Re: Looking for a NIO client/server example
From: Vincent Cantin (Pere.Noel_at_lutin.fr)
Date: 02/25/05
- Next message: Gordon Beaton: "Re: Looking for a NIO client/server example"
- Previous message: Gerbrand: "Re: about the xhtml parser"
- In reply to: Chris Berg: "Looking for a NIO client/server example"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 25 Feb 2005 20:34:01 +0800
"Chris Berg" <spame@eggs.spam> ???
news:dpst11p2ibfkk6ai1iet8hogniabm221pp@4ax.com ???...
> My client/server application works with sockets, one for each user,
> the sockets remain open for the entire session. Each client has a
> separate thread on the server. A traditional design, but limited in
> the max. number of conccurrent clients.
>
> I think using non-blocking NIO should be able to greatly enhance the
> system. However, there are two obstacles:
>
> 1) I need to re-write the thread code, especially the logic for
> creation/destruction of a session, as there is now no thread that
> governs the state of a user. This involves creating a state-vector and
> a state-machine. But I can see a way through that.
>
> 2) I need to understand NIO in more detail. Looking at Sun's examples,
> it looks quite a bit more complicates that old IO. Specifically, my
> protocol has telegrams whose size can only be determined at run-time,
> an that are in principle limitless. As I understand the NIO socket
> handling, this complicates matters quite a bit as it uses fixed-size
> buffers, but I may have misunderstood something.
>
> So, my question:
>
> Does anyone know of an example somewhere on the web that can be used
> as a pattern?
>
> Chris
Hi Chris,
Take a look on the JNAG project : https://jnag.dev.java.net/
Even if it is still in prototype version, it may help you to understand how
NIO works and how to use it.
Vincent
- Next message: Gordon Beaton: "Re: Looking for a NIO client/server example"
- Previous message: Gerbrand: "Re: about the xhtml parser"
- In reply to: Chris Berg: "Looking for a NIO client/server example"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|