J
John
Is there anyway open a socket so that every send/listen/recv
goes thru a zipping/unzipping process automatically?
Thanks,
--j
goes thru a zipping/unzipping process automatically?
Thanks,
--j
John said:Is there anyway open a socket so that every send/listen/recv
goes thru a zipping/unzipping process automatically?
> As far as I know, there is not a prefabbed solution for this problem. One
> issue that you must solve is the issue of buffering (when must some data you've
> written to the compressor really go out to the other side) and the issue of
> what to do when a read() or recv() reads gzipped bytes but these don't produce any
> additional unzipped bytes---this is a problem because normally a read() that
> returns '' indicates end-of-file.
>
> If you only work with whole files at a time, then one easy thing to do is use
> the 'zlib' encoding:
> 'abc'
> ... but because zlib isn't self-delimiting, this won't work if you want to
> write() multiple times, or if you want to read() less than the full file
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.