[erlang-questions] Hackney socket

Benoit Chesneau bchesneau@REDACTED
Wed Dec 24 18:45:23 CET 2014


On Wed, Dec 24, 2014 at 12:40 PM, Roberto Ostinelli <roberto@REDACTED>
wrote:

> Hello,
> I'm using hackney to send a HTTPS request. The server I'm connecting to
> will keep the resulting TCP connection open, so that it then becomes a
> two-way communication channel using HTTP chunk.
>
> I therefore need to retrieve the Socket from a Connection Reference, so I
> can send chunked data into it.
>
> Does anyone know what is the cleanest way to retrieve the underlying
> socket from a Connection Reference?
>
> Best,
> r.
>
>
If you want to reuse the socket and cancel the request then you can use
`hackney:cancel_request/1` . Note that you can directly send chunks using
hackney if you specify the Tranfer-Encoding header. Hackney will take care
about it. It also works if you want to stream the request.

- benoit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141224/a4dca05e/attachment.htm>


More information about the erlang-questions mailing list