Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Ionic.Zlib.dll and multiple operations

$
0
0
My solution was to implement a new parameter to the ConnectionInfo constructor which controls the usage of compression. Initial testing is very promising, the connection that need compression got it (only used for port forwarding), but the other ones don't. The exceptions that I got before is gone. Under is what I changed (except for all the changes to derived classes of ConnectionInfo). I hope this can help others that get stuck on this.

I replaced
public ConnectionInfo(string host, int port, string username, ProxyTypes proxyType, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword, params AuthenticationMethod[] authenticationMethods)
with
public ConnectionInfo(string host, int port, string username, ProxyTypes proxyType, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword, bool useCompression, params AuthenticationMethod[] authenticationMethods)
and replaced
this.CompressionAlgorithms = new Dictionary<string, Type>()
{
    //{"zlib@openssh.com", typeof(ZlibOpenSsh)}, 
    //{"zlib", typeof(Zlib)}, 
    {"none", null}, 
};
with
if (!useCompression)
{
    this.CompressionAlgorithms = new Dictionary<string, Type>()
    {
        {"none", null},
    };
}
else
{
    this.CompressionAlgorithms = new Dictionary<string, Type>()
    {
        {"zlib", typeof (Zlib)}, 
    };
}

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>