[erlang] gen_tcp传输文件原型

摘要: 有相关的代码需要使用gen_tcp传输文件 把写的原型发出来 1 -module(tcp). 2 -export([client/1,server/1]). 3 4 client(Port) -> 5 Host = "localhost", 6 {ok,Sock} = gen_tcp:connect(Host,Port,[binary,{packet,0}]), 7 ok = gen_tcp:send(Sock,"/tmp/ecstore.tar"), 8 receive_data(Sock,[]). 9 10 receive_data(Socke 阅读全文
posted @ 2012-09-10 17:13 bluefrog 阅读(1896) 评论(1) 推荐(0)