common_func.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:shootback 作者: aploium 项目源码 文件源码
def _wr_shutdown(self, conn, once=False):
        """action when connection should be write-shutdown
        :type conn: socket.SocketType
        """
        try:
            conn.shutdown(socket.SHUT_WR)
        except:
            pass

        if not once and conn in self.map:  # use the `once` param to avoid infinite loop
            #   pair should be rd_shutdown.
            # if a socket is wr_shutdowned, then it's
            self._rd_shutdown(self.map[conn], True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号