[erlang-questions] gen_tcp recv web content

月忧茗 <>
Fri Mar 29 08:54:36 CET 2013


Thanks


2013/3/28 Chandru <>

> Change HTTP/1.1 to HTTP/1.0. The server will then close the connection
> when it has sent all the data.
>
>
> On 28 March 2013 08:16, 月忧茗 <> wrote:
>
>>
>> Hi,
>>
>> I'm learning Erlang, And I have some code, to get web site content.
>>
>> http://pastebin.com/BDeUuymX
>>
>>
>> in erlang shell:
>>
>>
>> c(test).
>> test:start("www.yahoo.com", 80).
>>
>> I MUST waiting for the remote website close the socket,
>>  after that,  I got {tcp_closed, Socket} msg,
>> then finish the loop.
>>
>> But,  Waiting for remote close socket was takes a 'long' time,
>>
>> Is there any way to know, i have already get the whole data, and close
>> the socket by myself?
>>
>>
>> using Content-Length?  How?
>>
>>
>> another question:
>>
>> test:start("github.com", 443).
>>
>> when play with such this 'https' sites,  the code can not working.
>> It seems like being blocked.  can not receive the data, and finally
>> closed by remote sites.
>>
>>
>> Thanks.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> My GitHub
>> https://github.com/yueyoum
>>
>> My Blog
>> http://codeshift.org
>>
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>


-- 
My GitHub
https://github.com/yueyoum

My Blog
http://codeshift.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130329/5009ae6d/attachment.html>


More information about the erlang-questions mailing list