OFChannelHandler.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:athena 作者:
@Override
public void channelDisconnected(ChannelHandlerContext ctx,
        ChannelStateEvent e) throws Exception {
    log.info("Switch disconnected callback for sw:{}. Cleaning up ...",
            getSwitchInfoString());
    if (thisdpid != 0) {
        if (!duplicateDpidFound) {
            // if the disconnected switch (on this ChannelHandler)
            // was not one with a duplicate-dpid, it is safe to remove all
            // state for it at the controller. Notice that if the disconnected
            // switch was a duplicate-dpid, calling the method below would clear
            // all state for the original switch (with the same dpid),
            // which we obviously don't want.
            log.info("{}:removal called", getSwitchInfoString());
            if (sw != null) {
                sw.removeConnectedSwitch();
            }
        } else {
            // A duplicate was disconnected on this ChannelHandler,
            // this is the same switch reconnecting, but the original state was
            // not cleaned up - XXX check liveness of original ChannelHandler
            log.info("{}:duplicate found", getSwitchInfoString());
            duplicateDpidFound = Boolean.FALSE;
        }
    } else {
        log.warn("no dpid in channelHandler registered for "
                + "disconnected switch {}", getSwitchInfoString());
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号