Function shutdown

Synopsis

#include <src/uvw/stream.h>

void shutdown()

Description

Shutdowns the outgoing (write) side of a duplex stream.

It waits for pending write requests to complete. The handle should refer to a initialized stream.
A ShutdownEvent event will be emitted after shutdown is complete.

Source

Lines 174-183 in src/uvw/stream.h.

void shutdown() {
    auto listener = [ptr = this->shared_from_this()](const auto &event, const auto &) {
        ptr->publish(event);
    };
    auto shutdown = this->loop().template resource<details::ShutdownReq>();
    shutdown->template once<ErrorEvent>(listener);
    shutdown->template once<ShutdownEvent>(listener);
    shutdown->shutdown(this->template get<uv_stream_t>());
}





Add Discussion as Guest

Log in