cometd源码阅读-WebSocketTransport处理过程(六)

说明

comted内置协议

因为comted 有这些内置协议处理,所以上层协议就是应用层 可以是websoket 也可以是长连接轮训 或者轮训jsonp

    /**
     * 建立握手
     * 当建立连接后 需要访问这个渠道进行握手 comted将维护内置的连接信息
     * Constant representing the handshake meta channel.
     */
    public final static String META_HANDSHAKE = META + "/handshake";
    /**
     * 建立连接
     * 可以理解成是一个心跳,告诉comted自己还活着,以及一定时间断开连接后重新连接续约,同时也会获取到最新消息
     * Constant representing the connect meta channel
     */
    public final static String META_CONNECT = META + "/connect";
    /**
     * 订阅渠道
     * 订阅渠道,可以通过渠道完成类似聊天室的功能 一对一 一对多 多对多
     * Constant representing the subscribe meta channel
     */
    public final static String META_SUBSCRIBE = META + "/subscribe";
    /**
     * 取消订阅渠道
     * Constant representing the unsubscribe meta channel
     */
    public final static String META_UNSUBSCRIBE = META + "/unsubscribe";
    /**
     * 断开连接
     * Constant representing the disconnect meta channel
     */
    public final static String META_DISCONNECT = META + "/disconnect";

握手源码

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章