绑定到router
c2s->rouer:
<bind xmlns='http://jabberd.jabberstudio.org/ns/component/1.0' name='c2s'/>
router->c2s:
<bind xmlns='http://jabberd.jabberstudio.org/ns/component/1.0'/>
c2s收到服务器返回的bind消息后,最终执行函数:
c2s_router_sx_callback
case event_PACKET:
如果没有出错的话,并且此时c2s还没有监听5222端口,则开始建立服务器端socket
c2s->server_fd = mio_listen(c2s->mio, c2s->local_port, c2s->local_ip, _c2s_client_mio_callback, c2s)
返回成功后,将状态改为online
c2s->online = c2s->started = 1
至此已经做好连接客户端的准备。