0

The situation is: a server has many open connections with custom BodyStreamWriter (for server push), and all the clients close the connections on their side. I see two issues:

  1. fasthttp seems keeping all the related internal objects in memory
  2. BodyStreamWriter is not aware of the closure and does not dispose all the related objects/resources too

Is there any way to prevent the issues above? Thanks!

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
  • PING/PONG is a good technique!! – Aristofanio Garcia Aug 19 '18 at 13:41
  • I don't try! Try changes MaxKeepaliveDuration. KeepAlive is a socket mechanism to check if connect is live! (See more in https://github.com/valyala/fasthttp/search?q=keepalive&unscoped_q=keepalive and https://stackoverflow.com/questions/1480236/does-a-tcp-socket-connection-have-a-keep-alive) – Aristofanio Garcia Aug 19 '18 at 13:55
  • @AristofanioGarcia thank you. AFAIK keep-alive http header is for reusing same TCP connection for multiple HTTP requests. However, I'm your ping/pong suggestion will definitely work, thank you! I've found more on http connection close here: https://www.safaribooksonline.com/library/view/http-the-definitive/1565925092/ch04s07.html – Denis Karpov Aug 19 '18 at 17:09

0 Answers0