Server.py 文件源码

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

项目:Sample-Code 作者: meigrafd 项目源码 文件源码
def start(self):
        printD("streamserver: start")
        self.running = True
        while self.running:
            frame = self.videostream.read()
            serialized_data = msgpack.packb(frame, default=msgpack_numpy.encode)
            # Write the length of the capture to the stream and flush to ensure it actually gets sent
            data_len = len(serialized_data)
            printD("data_len: %d" % data_len)
            self.connection.write(struct.pack('<L', data_len))
            self.connection.flush()
            # Send the image data over the wire
            self.connection.write(serialized_data)
            self.connection.flush()
            printD("send.")
            sleep(0.001)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号