http://blog.csdn.net/pkutao/article/details/8572216 {ok, Listen} = gen_tcp:listen(?defPort, [binary, {packet, 2},{reuseaddr, true},{active, true}]),%gen_tcp表用TCP连接%binary表二进制流方式%packet,2:表包头长度2字节%reuseaddr, true:表多个实例可重用同一端口% {active,true} 创建一个主动套字节(…