jchristn / SuperSimpleTcp

Simple wrapper for TCP client and server in C# with SSL support
MIT License
459 stars 95 forks source link

Keep Alive in linux container #199

Closed mickeldebs closed 1 year ago

mickeldebs commented 1 year ago

Hello, I have a problem getting tcp keep alive to work in a linux docker container. I'm ASP NET Core 7. Tried running the app on windows and keep alive is working normally. When running in a linux container its not, not seeing any logs saying that its not supported. I tried setting the sysctl options in my docker-compose too but not working:

sysctls:
      - net.ipv4.tcp_keepalive_time=5
      - net.ipv4.tcp_keepalive_intvl=5
      - net.ipv4.tcp_keepalive_probes=3

Am I missing something? if not is there a workaround to this issue?

jchristn commented 1 year ago

Hi, this library doesn't implement the keepalives directly, rather, it passes these values to the underlying implementation. I can't provide any guarantee of them working since it's not code I manage.