开发者

How to Keep the socket live

开发者 https://www.devze.com 2023-03-14 09:27 出处:网络
We are working on communicating between Filezilla Client and Filezilla Server having two proxies in between them. Between the two proxies we are having 2 tcp connection.

We are working on communicating between Filezilla Client and Filezilla Server having two proxies in between them. Between the two proxies we are having 2 tcp connection.

filezilla client -> P1 --2----- P2 -> filezilla server.

The problem we are getting is while upload filezilla client will send the entire data to P1 and P1 send the data to P2. But P2 recv. speed is not as fast as P1 sending speed. P1 will close the connection after some time but as the P2 is still trying to recv data from P1 so it will not be able to recv and it will fail.

Is there any way to keep the soket alive till the other end will recv the data completely?

  1. I have tried using Linger with different timeout options. but it's not handling all the scenarios.

  2. I have tried setting the socket option keepalive, but still the same problem persists.

Can anyone pl开发者_开发知识库ease help or suggest me something?


When P2 receives information that the connection is closed from other end it should read remaining bytes from the socket before closing the connection from its end.


Thanks to all for your contribution on this thread, problem has been resolved using SHUTDOWN function....

Regards Nidhi

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号