Can python socket recieve fill if not read? -


if don't read python tcp socket, fill , cause error ? in code use .send() , there seem ack reply device i'm talking to. if don't read these out, build , create problem ? keep storing them infinitely ? surely cause memory issue ... thanks.

if don't read tcp socket recv buffer on receiving end , send buffer on seinding end fill up, @ point program block on further send() calls.

how memory each process use depends on size of buffers, depends on operating system , socket options. example, on linux situation this:

$ ss -tpn state  recv-q send-q  local address:port peer address:port    estab  0      2595384 127.0.0.1:3333     127.0.0.1:2222    users:(("python3",pid=13088,fd=3)) estab  964588 0       127.0.0.1:2222     127.0.0.1:3333    users:(("python3",pid=13087,fd=4)) 

the first line shows sending process (full send queue, ~2.6mb), second line receiving process (full recv queue, ~1mb).

this happens because during data transfer using tcp, each ack receiver tells sender how data ready accept next transmission. if rec buffer full, send buffer fill , no more data can sent.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -