Question

I am make a application base on lwip,the applcation just send data to the server; When my app works for some times (about 5 hours),I found that the send thread hung in send() function,and after about 30min send() return 0,and my thread run agin; In the server side ,have make a keepalive,its time is 5min,when my app hungs,5min later the server close the sockect,but my app have not get this,still hungs in send() until 30min get 0 return; why this happen? 1: the up speed is not enough to send data,it will hungs in send? 2: maybe the server have not read data on time,and it make send buff full and hungs?

how can i avoid these peoblems in my code ? I have try to set TCP_NODELAY,SO_SNDTIMEO and select before send,but also have this problem.

No correct solution

OTHER TIPS

send() blocks when the receiver is too far behind the sender. recv() returns zero when the peer has closed the connection, which means you must close the socket and stop reading.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top