摘要:
Server:-module(echo).-export([listen/1]).-define(TCP_OPTIONS, [binary, {packet, 0}, {active, false}, {reuseaddr,true}]).% Call echo:listen(Port) to start the service.listen(Port) -> {ok, LSocket} = gen_tcp:listen(Port, ?TCP_OPTIONS), spawn(fun()->accept1(LSocket) end), spawn(fun()->accept2( 阅读全文