rfc2217.py 文件源码

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

项目:mb_remote 作者: whaleygeek 项目源码 文件源码
def write(self, data):
        """\
        Output the given string over the serial port. Can block if the
        connection is blocked. May raise SerialException if the connection is
        closed.
        """
        if not self._isOpen: raise portNotOpenError
        self._write_lock.acquire()
        try:
            try:
                self._socket.sendall(to_bytes(data).replace(IAC, IAC_DOUBLED))
            except socket.error, e:
                raise SerialException("connection failed (socket error): %s" % e) # XXX what exception if socket connection fails
        finally:
            self._write_lock.release()
        return len(data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号