Hi Paŭlo,

Thanks for your reply.

I don't think I need a "resumption", so a reconnection being totally new is 
fine. To be honest, even bombing out and exiting the program is acceptable, and 
I can reload externally.

So the issue with regularly polling or similar. I have a feeling something can 
be done with setServerAliveInterval? Can that be set, and then regularly poll 
the session to see if it thinks it's connected? Is that the best way? I feel 
somehow reacting to something classed as a disconnect must have come up 
before...

Michal.



On 27 Feb 2012, at 20:55, Paul Ebermann wrote:

> Michal Charemza skribis:
>> Hi,
>> 
>> I'm using this library in a project, with tunnelling, and I'm
>> wondering if there is a mechanism that will auto-reconnect on a
>> disconnect. Is this possible? I've searched for a configuration
>> parameter, but not managed to find anything. Is there a way of using
>> some sort of callback, or maybe a subclass of Session? I'm not really
>> sure where to begin, so any pointers would be appreciated.
>> 
>> There is no-user interaction on connection/re-connection, so there is
>> no need for the system to prompt the user for a password/passphrase.
> 
> The SSH protocol doesn't have a notion of a "session resumption" or similar, 
> so a reconnection would be a totally new connection, and also all the 
> channels which go over the encrypted session are thus broken, and need to be 
> restarted.
> 
> You can manually "resume" a session by simply starting a new session with the 
> same parameters, and then starting these channels again.
> 
> The problem would be how to know when the session is down ... I don't have a 
> solution for this, other than regularly polling, or having a channel with an 
> echo or similar.
> 
> 
> Paŭlo


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to