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

前端 未结 4 1295
终归单人心
终归单人心 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:40

    First of all base64 over ssl will be slow anyway, ssl itself is slower then raw transport. File transfers are not done over base64 now days, http protocol is much more stable than anything else and most libraries on all platforms are very well stable. Base64 takes more size then actual data, plus the time to encode.

    Also, your following line may be a problem.

    ThreadInfos.wait.setvalue((csize / size) * 100);//outputs value to the gui
    

    If your this line is blocking, then this will slow down for every 4kb. Updating for every 4kb is also not right, unless a progress value from previous value differs by significant amount, there is no need to update ui for it.

提交回复
热议问题