As with most I/O objects, a websocket stream is [*not thread-safe]. Undefined behavior results if two different threads access the object concurrently. For multi-threaded programs, the `tcp_stream` can be constructed from an executor, in this case a strand. The stream declared below will use a strand to invoke all completion handlers:
As with most I/O objects, a websocket stream is [*not thread-safe]. Undefined behavior results if two different threads access the object concurrently. For multi-threaded programs, the `tcp_stream` can be constructed from an executor, in this case a strand. The stream declared below will use a strand to invoke all completion handlers: