adriancable / webtransport-go

Lightweight but fully-capable WebTransport server for Go
MIT License
114 stars 11 forks source link

How to handle the idle of the inactive session #6

Open minchopm opened 11 months ago

minchopm commented 11 months ago

I'm experiencing an issue in my Go project related to connection handling. When a connection drops for a few seconds and the timeout is configured for, say, 30 seconds, the sUni.Write method attempts to send a message. However, during this period, the session seems to be inactive, leading to a significant spike in CPU load.

A simple way to reproduce this issue is by refreshing the browser while the user is connected.

Could you provide guidance or a solution for managing the idle time period or ensuring that the sUni.Write method doesn't cause high CPU utilization when the session is inactive?

Thank you for your assistance.