Hi Saurabh, I think I've just resolved this issue to some extent. It seems like your SecurityManager allows you to create a thread but doesn't allow you to destroy it, which is weird. Anyways, please try the latest build.
HTH,
2008-01-31 (목), 10:25 -0800, Saurabh Jain 쓰시길:
> When i try to use close at client side then i get a
> java.security.AccessControlException: access denied
> (java.lang.RuntimePermission modifyThread) due to the Security manager
> implementation of my application. Does close operation require any specific
> permissions?
>
> Also I have gone through the examples and i think this is the same mechanism
> used in the examples. (May be I have missed something [:(] ) I followed the
> chat example.
>
> Saurabh.
>
>
> Niklas Therning wrote:
> >
> > Saurabh Jain wrote:
> >> Hi,
> >>
> >> I am writting a Client-Server application with mina. I am having problem
> >> in
> >> gracefully shutting down the client. the way i am trying to do is:
> >> - The client sends a logout request to the server.
> >> - The server does the clean up and closes the connection.
> >> - The client is waiting for the connection to be closed by the server.
> >> - As soon as the connection is closed the client does the cleanup and
> >> exit.
> >>
> >> The first two steps are fine. But the client is not recieving close
> >> notification, due to this the client is hanging.
> >>
> >> The code is as under:
> >>
> >> On server side when I recieve LOGOUT:
> >> session.close();
> >>
> >> On Client Side:
> >> GenericRequest req = new
> >> GenericRequest(Constants.REQ_LOGOUT, null);
> >> WriteFuture future = session.write(req);
> >> future.awaitUninterruptibly();
> >> conHandler.shutdown();
> >> pinger.shutDown();
> >> System.out.println("Waiting to close::");
> >> this.session.getCloseFuture().awaitUninterruptibly();
> >> System.out.println("Closed ");
> >>
> >> The client is hanging on
> >> this.session.getCloseFuture().awaitUninterruptibly();
> >>
> >> Please let me know what is the right way to gracefully shut down a client
> >> application.
> >>
> >> Thanx,
> >> Saurabh
> >>
> >>
> >>
> >
> > Maybe the client session's CloseFuture is only notified when you call
> > session.close() on the client side. I'm not sure how it's supposed to
> > be. If you use
> >
> > this.session.close().awaitUninterruptibly();
> >
> > it might work better?
> >
> > --
> > Niklas Therning
> > www.spamdrain.net
> >
> >
> > -----
> > Niklas Therning
> > www.spamdrain.net
> >
>
--
Trustin Lee - Principal Software Engineer, JBoss, Red Hat
--
what we call human nature is actually human habit
--
http://gleamynode.net/
signature.asc
Description: This is a digitally signed message part
