Open UlyanaAndrukhiv opened 1 week ago
Attention: Patch coverage is 50.00000%
with 17 lines
in your changes missing coverage. Please review.
Project coverage is 41.22%. Comparing base (
8a3055c
) to head (04e392c
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
LGTM! Let's add tests for this in this PR as they're related https://github.com/onflow/flow-go/pull/6757
Closes: #6638
Context
This PR implements the initial
WebSocket
connection configuration for the newWebSocket controller
. The changes focus on setting up timeouts and ensuring the connection remains responsive, preventing the server from blocking indefinitely while waiting for the client to send or receive messages:configureConnection:
Sets an initialread deadline
to prevent waiting indefinitely for a pong message. Establishes aPong handler
that resets the read deadline each time a pong is received, keeping the connection alive.Write Deadline Timeout:
AddsSetWriteDeadline
to ensure write operations time out if not completed withinwriteWait
, preventing resource exhaustion from slow or unresponsive clients.