Skip to main content

belongs_on_a_request_stream

Function belongs_on_a_request_stream 

Source
fn belongs_on_a_request_stream(ty: MessageType) -> bool
Expand description

Whether draft-20 Table 5 places this message on a request stream that is already open.

All five of the messages Table 5 marks “Request” without their beginning one: REQUEST_UPDATE modifies the request its stream carries (Section 10.9), NAMESPACE and NAMESPACE_DONE report namespaces on the SUBSCRIBE_NAMESPACE stream that asked for them (Sections 10.17 and 10.18), PUBLISH_SKIPPED names a track on the SUBSCRIBE_TRACKS stream that asked for it (Section 10.20), and PUBLISH_STATE_NOTIFY — new in draft-20 — reports a change on the subscription’s own stream (Section 10.10).

Endpoint::receive_message already closes the session over all five when they arrive on the control stream. Without this the client would write on the control stream exactly what its own peer half refuses to read there.