Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC, not for merge] Net: Websocket: introduce non-blocking receive frame API #4709

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Sep 24, 2024

  1. Net: Websocket: introduce non-blocking receive frame API

    Currently, the Receive Frame of WebsocketImpl is implemented in a way, that it
    expects for a single websocket frame to be received in a blocking fashion:
    untill frame gets received, context is blocked till completion.
    
    This is an issue with poor-network-connection clients that
    connect to server in a way, that clients with high packet
    loss / clients that send only part of a WSS frame could
    potentially lock-up processing thread for a very long
    time.
    
    This fix implements a new set of coroutines, that mimic
    the behavior of previous implementation, however are
    aimed to use internal buffer for caching partially
    received frame, and return one whenever frame assembly
    is completed.
    This proves to unblock the caller thread from any hussle
    with bad connections, and enables the true async
    implementation of socket processing.
    
    Signed-off-by: Oleksandr Mazur <[email protected]>
    Cahb committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    1b8ccbe View commit details
    Browse the repository at this point in the history