Author Topic: Problem on socket listener  (Read 106 times)

Hello,
I want to create a plugin to connect Substance with a custom application linked to Ftrack.
For that I need a socket between Substance and my custom app so the socket is created and I can send message from Substance to my app but the answer never comes back. (The code works on Max and Maya.)

Here is the code of connection:
def Client(address, timeout = None):
    """
        Creates a TCPConnection object corresponding to a client and assign it its socket.

        :param address: Address on format ``(ip, port)`` on which the socket will connect.
        :type address: tuple(str, int)
        :param timeout: Maximal duration that will be applied to socket's blocking operations.
        :type timeout: float
        :return: The connection object that can be used as a client.
        :rtype: :class:`TCPConnection`

    """

    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect(address)
    sock.settimeout(timeout)
    return TCPConnection(sock)

self.connection = Client((addressesToUse['ip'], addressesToUse['tcpPort']), socketTimeout)
#addressesToUse = {'ip': '127.0.0.1', 'tcpPort': 9007, 'webPort': 9008}



Has anyone else run into this and how do I fix it?

Thanks!

Hello,

Which version of Designer are you using?

Est.

I have try with 2019.1.0 and 2019.1.1

Sorry, I found my mistake, it was in my code not in Substance