Steve Ash wrote:
I didn't get any responses last time, and I haven't made any progress
myself.  Sorry to bother everyone, but I cannot find good outlines for
how this is supposed to be done.  Sorry to repost this!  Thanks in
advance for any assistance anyone can provide.
Np, you can repost if you didn't get any answer. But if nobody answer, it may mean that no one knows what's going on with your application :/
So this is my lifecycle currently, and it is working except that it
appears after my connector.dispose() is called, I get an exception on
the server indicating it is writing to a closed socket.
Likely because the client has already closed the connection. I'm not 100% sure, but waiting on the CloseFuture is just about waiting for everything to be close and clean on the client side. The socket may be already close, and the server can't write anything to the client, leading to this exception (from the top of my head).
So I have a few questions that I didn't see clearly explained on the
website that hopefully someone can clear up.

1)      When a client is "done" with his processing what is the intended
way to end this exchange-the client closes the session, the server
closes the session, both, or what?
Depends. If you write a server, you should assume that the client may close the connection abruptly. From the client POV, you must also assume the very same thing. So it does not make any difference, IMO.

However, the client is usually closing the connection first.
This is where I am most confused
about the intended lifecycle of sessions between the server and client.

2)      Do I always call connector.dispose() when I am ready to shut
down the entire client or am I missing the point of this method?  If I
don't call dispose, my application never quits as the connector thread
doesn't exit.
call dispose().
3)      Should I be blocking in the client until the business logic
"done" request comes back (i.e. block on the writeFuture)?
Sounds a good idea. As you are expecting more data, just wait for it to come back, no ?
So that I
don't close the session until after the server is done sending the "ok"
for the "done" request.
sounds good.
4)      What is an example where you would not call dispose.  i.e. if
you have a multithreaded client that all talks to the same server?
Would these all go through the same connector?
I don't know :/ Anyone ?

--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to