Community Forum
ANVEL Licensing Options

Fix for Slow StepSimulation API Calls on Ubuntu



  • A user asked why their Python script that ran fast on Windows was running slow on Ubuntu 16.04.

    It turns out, there is a difference in the default thrift settings on Ubuntu so an additional line is needed.

    See example scripts at:
    https://wiki.anvelsim.com/index.php/Python_Usage_of_ANVEL_API

    At the top of the script, in the ANVEL connection function, you will see:

    trans = TSocket.TSocket('127.0.0.1', 9094)
    proto = TBinaryProtocol.TBinaryProtocol(trans)
    anv = AnvelControlService.Client(proto)
    trans.open()

    The fix would be:

    trans = TSocket.TSocket('127.0.0.1', 9094)
    proto = TBinaryProtocol.TBinaryProtocol(trans)
    anv = AnvelControlService.Client(proto)
    trans.open()
    trans.handle.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

    (Remember to add "import socket"!)