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
Post a Comment