Python Forum
pickle.dump() and pickle.load() with non-blocking sockets - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: pickle.dump() and pickle.load() with non-blocking sockets (/thread-20264.html)



pickle.dump() and pickle.load() with non-blocking sockets - Skaperen - Aug-02-2019

i need to have non-blocking sockets to use select or poll. that results in distinctive conditions for "no more data, yet" (because the other end is slow writing large data) and "no more data, ever" (because the other end was closed). there is an equivalent for writing that deals with available space (rather small for interprocess pipes). what i am wondering is how well pickle.dump() and pickle.load() handle this. anyone know?

the data i will be passing over a pipe with pickle will be variable in length. it could be something small (way less than 256 bytes) or something very large (well over 65536 bytes) so the option of writing a fixed size every time is very impractical. but if a small amount is written, i need to be sure nothing blocks trying to buffer more data when there isn't any (but not EOF, either)