JSch: How to keep the session alive and up

前端 未结 3 701
攒了一身酷
攒了一身酷 2020-12-08 11:05

I\'m writing Java GUI program for static route management using SSH. My code is as follows:

import com.jcraft.jsch.*;
import java.io.*;

public class Konsep          


        
3条回答
  •  有刺的猬
    2020-12-08 11:50

    You can try by invoking the following method before invoking Session#connect().

    Session#setServerAliveInterval(int milliseconds)

    Although I found one more function Session#sendKeepAliveMsg() which can be tried.

提交回复
热议问题