httpc:request pipelining example and blocking problem

Vance Shipley vances@REDACTED
Sat Dec 18 04:56:03 CET 2021


Anthony,

The trick is to use a unique Profile (e.g. foo) for all the requests
to the pipelined server.

     inets:start(httpc, [{profile, foo}]),
     httpc:set_options([{keep_alive_timeout, 4000}],  foo).

You MUST set the keep alive timeout.  The server settings must also be
compatible.

On Sat, Dec 18, 2021 at 6:23 AM Anthony Howe <achowe@REDACTED> wrote:
>
> I'm trying to exclusively use inets httpc for some simple REST request.  Please
> do NOT suggest other Erlang HTTP clients; the exercise is to only use inets
> httpc.  The docs for the httpc client are pretty poor and online searches
> haven't helped.
>
> Two questions:
>
> 1. Does anyone have an example of using inets httpc to do pipeline requests?
>
> 2. I've managed a single asynchronous request to a Ruby based service which
> worked fine.  Now when I try make a request to an Erlang Cowboy based service
> (an old Erlang 19 3rd party application), the request goes through and the reply
> sent (as observed using tcpdump), but the process blocks until the timeout,
> never returning the response.
>
> --
> Anthony C Howe                                                 SnertSoft
> achowe@REDACTED     Twitter: SirWumpus            BarricadeMX & Milters
> http://snert.com/    http://nanozen.snert.com/     http://snertsoft.com/



-- 
     -Vance


More information about the erlang-questions mailing list