Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum Dynamic server port

  • Paul Mulroney

    Member
    February 17, 2021 at 8:46 am

    I don’t think so. Is there a reason why you’re not assigning a port number? You could pick a known value, then there wouldn’t be any issues.
    We had some code that would dynamically set the server port, but only after it determined that the port wasn’t already in use. This would prevent Omnis from hanging on startup waiting for the port to become available.
    Regards,
    Paul.

  • Philip Tulett

    Member
    June 9, 2022 at 6:44 pm

    Hi there,


    In Studio 10.2 I use the following line of code to obtain the port the server is listening on:-

    Calculate ip_port as $modes.$dotoolmethod(kEnvToolBrowser,160)

    You can also use “$prefs.$serverport” to obtain the static port, but that is not reliable when using Dynamic Port assignment.

  • Jason Gissing

    Administrator
    June 13, 2022 at 9:32 am

    Hi Stefano,

    You should be able to use $modes.$serverport to get the resolved serverport.

Log in to reply.