0 votes
by (140 points)

I inherited code which used an older version of Rebex. I am trying to upgrade it to work around a SCP::FileGet issue but am finding some incompatibilites. Is there a page that describes how to convert from older versions? The old versions included Rebex.Networking, Version=3.0.4444.0 and Rebex.Terminal, Version=1.0.4444.0 and I am trying to replace it with Version=6.0.8432.0. The old .Net was 4.5.2 and I am updating this to 4.6.

The incompatibilities I have are:

  1. Rebex::Net::ScpTransferProgressEventHandler seems to be missing. This was used to add a C++ handler like this:
    m_scp->TransferProgress += gcnew Rebex::Net::ScpTransferProgressEventHandler(&MyClass::OnTransferProgress);
    where OnTransferProgress is declared within a C++ class as
    static void OnTransferProgress(Object^ sender, Rebex::Net::ScpTransferProgressEventArgs^ args);
    How should I now add this handler?

  2. There is also an instantiation of Rebex.TerminalEmulation.SshTerminalControl, which I cannot find in Rebex.Terminal.Control, though it is mentioned on this page: https://www.rebex.net/terminal-emulation.net/features/terminal-emulation.aspx and I find this class in a sample. Could I simply use Rebex.TerminalEmulation.TerminalControl instead?

1 Answer

0 votes
by (148k points)

There is no KB article on upgrading yet, but fortunately, these slight incompatibilities are easy to resolve.

1) Instead of ScpTransferProgressEventHandler, use EventHandler<ScpTransferProgressEventArgs^> (I'm not quite sure whether this is the proper C++/CLI, so please let me know if it's wrong). The ScpTransferProgressEventHandler delegate was a leftover from .NET Framework 1.x era.

2) Yes, SshTerminalControl was just TerminalControl with some additional methods and properties, so reproducing the same functionality with TerminalControl is straightforward. The SshSimpleWinFormClient sample (comes with Rebex install package) actually provides a replacement implementation of SshTerminalControl in C# and VB.NET, and converting this to C++/CLI should be quite simple. (See R6.0 release notes for the reasons behind this change.)

by (140 points)
Thank you for your response. Yes this seems to work:
1. m_scp->TransferProgress += gcnew System::EventHandler<Rebex::Net::ScpTransferProgressEventArgs^>(handler);
2. I was able to simply replace SshTerminalControl with TerminalControl.
3. BeginGetFile and EndGetFile are now in Rebex::Legacy
Now I am just waiting on a fix for the Rebex::Net::GetFile handling of special characters (https://forum.rebex.net/22002/how-rebex-scp-getfile-get-file-that-has-single-quote-the-name?show=22173#c22173)
by (148k points)
Thanks for letting us know!
We already fixed handling of the special characters, but we are still working on some unrelated issues in the next release, so I'll send you a link to a hotfix.
...