Sehraf.RSRPC.RSSSHConnector.Reconnect C# (CSharp) Method

Reconnect() public method

public Reconnect ( ShellStream &stream ) : bool
stream Renci.SshNet.ShellStream
return bool
        public bool Reconnect(out ShellStream stream)
        {
            System.Diagnostics.Debug.WriteLineIf(DEBUG, "ssh: reconnecting ....");
            Disconnect();
            System.Threading.Thread.Sleep(500);
            if (Connect())
            {
                stream = _stream;
                return true;
            }
            else
            {
                stream = null;
                return false;
            }
        }

Usage Example

Exemplo n.º 1
0
 public bool Reconnect(out ShellStream stream)
 {
     _event(EventType.Reconnect, null);
     Thread.Sleep(500);
     _rsProtoBuf.BreakConnection();
     return(_rsConnector.Reconnect(out stream));
 }