OSC2.py 文件源码

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

项目:pyOSC3 作者: Qirky 项目源码 文件源码
def setClient(self, client):
        """Associate this Server with a new local Client instance, closing the Client this Server is currently using.
        """
        if not isinstance(client, OSCClient):
            raise ValueError("'client' argument is not a valid OSCClient object")

        if client.server != None:
            raise OSCServerError("Provided OSCClient already has an OSCServer-instance: %s" % str(client.server))

        # Server socket is already listening at this point, so we can't use the client's socket.
        # we'll have to force our socket on the client...
        client_address = client.address()   # client may be already connected
        client.close()              # shut-down that socket

        # force our socket upon the client
        client.setServer(self)

        if client_address:
            client.connect(client_address)
            if not self.return_port:
                self.return_port = client_address[1]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号