winIDEA SDK
Loading...
Searching...
No Matches
test_start_new_instance.py
# This script is licensed under BSD License, see file LICENSE.txt, or search for `License` in the SDK online help.
#
# (c) TASKING Germany GmbH, 2023
import isystem.connect as ic
import time
def test_startNewInstance():
print("Starting new instance with ID: 'startNewInstanceExample'...")
connMgr = ic.ConnectionMgr()
cfg1 = ic.CConnectionConfig()
cfg1.instanceId("sdk_example")
cfg1.cmd_line("/LOG:6")
connMgr.connect(cfg1)
port = cfg1.getTCPPort()
print(f"\tInstance created, port: {port}")
connMgr.disconnect_keep()
cfg2 = ic.CConnectionConfig()
cfg2.processTCPPort(port)
connMgr.disconnect_keep()
connMgr.connect(cfg2)
print(f'\tWinIDEA is connected: {connMgr.isConnected()}.')
connMgr.disconnect_close(False)
if __name__ == "__main__":
test_startNewInstance()