Lindawb 0 Posted February 17, 2022 Hello, Is it possible to send/receive compressed tmemorystream with WSocket ? if yes how please. piece of code will help Thank you Share this post Link to post
Angus Robertson 574 Posted February 17, 2022 Exactly the same as sending an uncompressed memory stream, TWsocket has no idea what type of data you are sending. If you mean how do you compress data in Delphi, there are lots of ways. The ICS web server uses ZLIB to compress HTTP responses. Angus Share this post Link to post
Lindawb 0 Posted February 17, 2022 Thank you, You mean first compress the stream with Zlib on Client side, then send it , on the server side read compressed stream , then decompress it and use it. are those steps correct ? I tried it yesterday but for some reason didn't work. Thanks again Share this post Link to post
FPiette 382 Posted February 17, 2022 1 hour ago, Lindawb said: You mean first compress the stream with Zlib on Client side, then send it , on the server side read compressed stream , then decompress it and use it. are those steps correct ? Those steps are correct. Remember the the receive side must know how many data to receive. You will likely receive several OnDataAvailable for significant amount of data. There is NEVER guaranteed relation between the number of Send() and the number of OnDataAvailable events. This is the biggest error many newbies are doing constantly. Be sure to read this documentation : http://wiki.overbyte.eu/wiki/index.php/Asynchronous_Paradigm Share this post Link to post