Movatterモバイル変換


[0]ホーム

URL:


everything curl

    Multiplexing

    The HTTP versions 2 and 3 offer "multiplexing". Using this protocol feature,an HTTP client can do several concurrent transfers to a serverover the samesingle connection. This feature does not exist in earlier versions of theHTTP protocol. In earlier HTTP versions, the client would either have tocreate multiple connections or do the transfers in a serial manner, one afterthe other.

    libcurl supports HTTP multiplexing for both HTTP/2 and HTTP/3.

    Make sure you do multiple transfers using the multi interface to a server thatsupports HTTP multiplexing. libcurl can only multiplex transfers when the samehostname is used for subsequent transfers.

    For all practical purposes and API behaviors, an application does not haveto care about if multiplexing is done or not.

    libcurl enables multiplexing by default, but if you start multiple transfersat the same time they prioritize short-term speed so they might then open newconnections rather than waiting for a connection to get created by anothertransfer to be able to multiplex over. To tell libcurl to prioritizemultiplexing, set theCURLOPT_PIPEWAIT option for the transfer withcurl_easy_setopt().

    Withcurl_multi_setopt()'s optionCURLMOPT_PIPELINING, you can disablemultiplexing for a specific multi handle.


    [8]ページ先頭

    ©2009-2025 Movatter.jp