title: How to Keep the socket live
body: <p>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. </p>
  
  <p>filezilla client -> P1 --2----- P2 -> filezilla server.</p>
  
  <p>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. </p>
  
  <p>Is there any way to keep the soket alive till the other end will recv the data completely?</p>
  
  <ol>
  <li><p>I have tried using Linger with different timeout options. but it's not handling all the scenarios.</p></li>
  <li><p>I have tried setting the socket option keepalive, but still the same problem persists.</p></li>
  </ol>
  
  <p>Can anyone please help or suggest me something?</p>