It turned out that after the sessions was closed the isexited function still returned true which caused the session to hang. My apologies, took me quite long to figure out :)
But now I have a second problem, the sshd needs to run on devices with batteries (like laptops) but battery drain increases a lot when someone is connected. It turns out after settings to log point that the isexited call from the shell class is called multiple times per second (a continuous loop) till the isexited returns true. My gues is that's eating a lot of power.. Would there maybe be some fix? Would it be safe to add a thread sleep to the isexited function? Keep up the good work though, it's a great server! So easy to use. Thanks again. Maarten 2012/9/3 Guillaume Nodet <[email protected]> > It should not be necessary. Closing the server should close all sessions > and shells. > I suppose you're using the latest 0.7.0 version. > Isn't the Command#destroy() method called ? > > On Sun, Sep 2, 2012 at 3:01 PM, Maarten Smit <[email protected]> > wrote: > > > Hello, > > > > I have implemented SSHD with my own Shell Factory. Everything works > great, > > however, this doesn't work: > > > > 1. A user connects > > 2. The user is done and closes the session without typing 'exit' first > (if > > the user quits correctly by typing exit through ssh everything works ok) > > 3. The server is stopped > > 4. The server is started again: that doesn't work since the port is still > > in use, probably because there is still a shell session (since if the > shell > > is closed everything works). > > > > I have tried: > > - setReuseAddress to true > > - using sshd.getActiveSessions() to get all sessions and disconnecting > each > > one > > > > But it still doesn't work. So my question is, when the server is stopped, > > how can I get access to each active shell outputstream so I can send the > > 'exit' command? > > > > Thanks! > > > > Maarten > > > > > > -- > ------------------------ > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > ------------------------ > FuseSource, Integration everywhere > http://fusesource.com >
