public virtual void Start() { CheckDisposed(); if (IsStarted) throw new InvalidOperationException("Forwarded port is already started."); if (Session == null) throw new InvalidOperationException("Forwarded port is not added to a client."); if (!Session.IsConnected) throw new SshConnectionException("Client not connected."); Session.ErrorOccured += Session_ErrorOccured; StartPort(); }
public void Open() { _client.Connect(); _forwardedPort = new ForwardedPortLocal(LocalHost, LocalPort, _mySqlHost, (uint)_mySqlPort); _client.AddForwardedPort(_forwardedPort); _forwardedPort.Start(); _connection.Open(); }