python socket programming settimeout() timer not reset each call -


the settimeout(10) function reset it's timer 10 when each time call connectionsocket.recv(1024)

i want timer reset if send active server. this:

timeout = 10 connectionsocket.settimeout(timeout) while 1:     sentence = connectionsocket.recv(1024)     if sentence.decode() == 'active':         #reset timer of settimeout() 

this application level constraint, not tcp can handle you.

you can set timeout acceptable error margin (eg. if want wait 10s total, timeout of 1s give 11s in worst case) , handle timeout of transaction yourself.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -