Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PowerBuilder) Check SSH Connection (IsConnected)Demonstrates how to check to see if the connection to the SSH server exists.
integer li_rc oleobject loo_Ssh integer li_Success integer li_Connected loo_Ssh = create oleobject // Use "Chilkat_9_5_0.Ssh" for versions of Chilkat < 10.0.0 li_rc = loo_Ssh.ConnectToNewObject("Chilkat.Ssh") if li_rc < 0 then destroy loo_Ssh MessageBox("Error","Connecting to COM object failed") return end if // Connect to an SSH server: li_Success = loo_Ssh.Connect("192.168.1.209",22) if li_Success <> 1 then Write-Debug loo_Ssh.LastErrorText destroy loo_Ssh return end if // Is the last known state "connected"? li_Connected = loo_Ssh.IsConnected if li_Connected = 1 then // Verify for sure by sending an ignore message. li_Connected = loo_Ssh.SendIgnore() end if Write-Debug "connected = " + string(li_Connected) // Disconnect. loo_Ssh.Disconnect() // Am I still connected? li_Connected = loo_Ssh.IsConnected Write-Debug "connected = " + string(li_Connected) destroy loo_Ssh |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.