morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
ws_connection.hpp File Reference

One WebSocket connection on an I/O loop: its socket, the frames waiting to be written, and the two flows that move bytes. More...

#include <algorithm>
#include <array>
#include <atomic>
#include <chrono>
#include <core/async/Task.hpp>
#include <core/net/EventLoop.hpp>
#include <core/net/ISocket.hpp>
#include <cstddef>
#include <deque>
#include <functional>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <utility>
#include "../../core/connection_writer.hpp"
#include "../../core/profiler.hpp"
#include "ws_handshake.hpp"

Go to the source code of this file.

Detailed Description

One WebSocket connection on an I/O loop: its socket, the frames waiting to be written, and the two flows that move bytes.

Shared by SocketBackend (client role) and SocketServer (server role). Everything here runs on the loop's thread and is touched nowhere else; the LoopConnection itself is held by shared_ptr from each flow that uses it, so a flow that resumes after its owner has let go of the connection still finds the socket object alive. The one exception is the backlog counter, pending, which other threads add to and read.

Definition in file ws_connection.hpp.