[erlang] gen_tcp传输文件原型(二进制)
摘要:
1 -module(tcp). 2 -export([client/3,server/1]). 3 4 client(Port,SiteID,Deploy) -> 5 Host = "localhost", 6 DeployBin = list_to_binary(Deploy), 7 {ok,Sock} = gen_tcp:connect(Host,Port,[binary,{packet,4}]), 8 ok = gen_tcp:send(Sock,<<SiteID:32,DeployBin/binary>>), 9 receive_dat 阅读全文