Sending files over TCP/ .NET SSLStream is slow/not working

前端 未结 4 1331
终归单人心
终归单人心 2021-01-15 13:59

Im writing an Server/Client Application which works with SSL(over SSLStream), which has to do many things(not only file receiving/sending). Currently, It works

4条回答
  •  耶瑟儿~
    2021-01-15 14:33

    I'd give a try of gzip compress before/after the network. From my experience, it helps. I'd say some code like this could help :

    using(GZipStream stream = new GZipStream(sslStream, CompressionMode.Compress)) 
    {
        stream.Write(...);
        stream.Flush();
        stream.Close();
    }
    

    Warning : It may interfer with SSL if the Flush is not done. and it will need some tests... and I didn't try to compile the code.

提交回复
热议问题