meta data for this page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
programming:python:socket [2023/12/28 14:04] – created niziak | programming:python:socket [2023/12/28 14:23] (current) – niziak | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== socket ====== | ====== socket ====== | ||
+ | [[https:// | ||
===== socket.makefile ===== | ===== socket.makefile ===== | ||
+ | |||
+ | [[https:// | ||
When accessing socket as file: | When accessing socket as file: | ||
Line 7: | Line 10: | ||
* read() reads until EOF, so EOF for sockets means that connection is closed. Workarounds: | * read() reads until EOF, so EOF for sockets means that connection is closed. Workarounds: | ||
* use '' | * use '' | ||
- | * use own framing protocol. I.e. first 4 bytes is always size of data payload | + | * use own framing protocol. I.e. Encode 32bit size on first 4 bytes (using '' |
+ | * When file is in binary '' | ||
+ | |||
+ | |||