server.py 文件源码

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

项目:multitude 作者: mesilliac 项目源码 文件源码
def open(self):
        """Called when a websocket connection is initiated."""

        # print some info about the opened connection
        print("WebSocket opened",
              "from user at {}".format(self.request.remote_ip))

        # add this connection to the set of active connections
        client_connections.add(self)

        # assign a random not-too-light colour
        self.color = '#'
        for i in range(3):
            self.color += hex(random.randint(0,13))[2:]

        # assign a nickname
        self.nickname = str(self.request.remote_ip)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号