Skip to content
  • Manuel Stoeckl's avatar
    Rewrite main proxy loop to use nonblocking sockets · 4d42fae3
    Manuel Stoeckl authored
    Previously, the main proxy loops in `run_server_child` and
    `run_client_child` alternated between making transfers from their shared
    channel to their individual wayland compositor/application channels.
    
    By using socket connections in nonblocking mode, the proxy now can
    simultaneously maintain transfers in both directions. This ensures that
    large transfers (such as a full-screen image) do not prevent e.g. key
    release events from being transferred.
    
    Additionally, as the two proxy loops were very similar, they have been
     combined into the `main_interface_loop` routine.
    
    The code still does not correctly handle the case where a read from
    the wayland compositor/application fills the entire read buffer and
    truncates a sent message, but it is now easier to adjust for that case.
    4d42fae3