winIDEA SDK
test_start_new_instance.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6import time
7
8
9def test_startNewInstance():
10 print("Starting new instance with ID: 'startNewInstanceExample'...")
11 connMgr = ic.ConnectionMgr()
12 cfg1 = ic.CConnectionConfig()
13 cfg1.instanceId("sdk_example")
14 cfg1.cmdLineParams("/LOG:6")
15 connMgr.connect(cfg1.start_always())
16 port = cfg1.getTCPPort()
17 print(f"\tInstance created, port: {port}")
18
19 cfg2 = ic.CConnectionConfig()
20 cfg2.processTCPPort(port)
21
22 connMgr.connect(cfg2)
23 print(f'\tWinIDEA is connected: {connMgr.isConnected()}.')
24
25
26if __name__ == "__main__":
27 test_startNewInstance()