标签:
ejabberd_listener作为supervisor启动
初始化的时候创建listen_sockets(ets)表
根据配置参数启动相应的接口
[{{5222,{0,0,0,0},tcp}, ejabberd_c2s, [{access,c2s},{shaper,c2s_shaper},{max_stanza_size,65536}]}, {{5269,{0,0,0,0},tcp},ejabberd_s2s_in,[]}, {{5280,{0,0,0,0},tcp}, ejabberd_http, [{captcha,true}, {http_bind,true}, {web_admin,true}, {request_handlers,[{<<"/websocket">>,ejabberd_http_ws}]}]}]
即为ejabberd_c2s,ejabberd_s2s_in,ejabberd_http
ejabberd_c2s作为连接客户端的请求server
ejabberd_s2s_in作为连接服务器的请求server
ejabberd_http作为http的请求server
但是此处指listen,并没有accept
Res = gen_tcp:listen(Port, [binary, {packet, 0}, {active, false}, {reuseaddr, true}, {nodelay, true}, {send_timeout, ?TCP_SEND_TIMEOUT}, {send_timeout_close, true}, {keepalive, true} | SockOpts]),
直到最后才开启接受连接
ejabberd_listener:start_listeners()
标签:
原文地址:http://www.cnblogs.com/lawen/p/5057615.html