[erlang] Erlang TCP(gen_tcp)
摘要:
1 -module(socket_example). 2 -compile(export_all). 3 4 nano_get_url() -> 5 nano_get_url("www.google.com"). 6 7 nano_get_url(URL) -> 8 {ok,Socket} = gen_tcp:connect(URL,80,[binary,{packet,0}]), 9 ok = gen_tcp:send(Socket,"GET / HTTP/1.0\r\n\r\n"), 10 receive_data(Socket,[].. 阅读全文