<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Scenario:&nbsp; TCP Receive Buffer on twisted HTTP server using the twisted application framework.&nbsp; And its behavior when set up as producer/consumer.<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">(1) Would like to set the receive buffer size on socket.&nbsp; One way to do this would be to create a derived class of TCPServer (or SSLServer) and set the buffer size and use derived class server in the .tac file.&nbsp; Would like to know if there is any sample code for such usage?&nbsp; For example, in which method of the derived class would one set
 the receive buffer size?<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">(2) When an incoming http POST request is acting as a producer of data, which is tied to a consumer resource (some other connection), how can I control the incoming tcp window size, if the consumer has paused consuming?&nbsp; I presume the incoming network data will keep piling up in the 'huge' tcp buffer eventually advertising a 'tcp zero window' to the network peer of the data producer, AND the server ends up using up a large amount of memory for the paused connection.&nbsp; Is there an alternative?&nbsp; I realize that the TCP protocol inhibits 'reducing of an already advertised receive window', but I am
 wondering if pauseProducing() on an http channel could do something to at least prevent the tcp window size from increasing any further?<br><br>Thank you,<br>Arun</div></div></body></html>