[erlang-questions] Hackney socket

Roberto Ostinelli <>
Sun Dec 28 10:59:47 CET 2014


Thank you Benoit!

Best,
r.

On Wed, Dec 24, 2014 at 6:45 PM, Benoit Chesneau <>
wrote:

>
>
> On Wed, Dec 24, 2014 at 12:40 PM, Roberto Ostinelli <>
> 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/20141228/e10bd140/attachment.html>


More information about the erlang-questions mailing list