Grapevine multi instance problem

+1 vote
asked May 8, 2016 in IRF tantárgy by Petrosz1991 (40 points)  

When I start 2 instance of the Grapevine.Example.exe and I try to call the implemeted methods, for one of the 2 instances works correctly, but for the other it cause the program to terminate.
Can someone help?

1 Answer

0 votes
answered May 8, 2016 by selton (25 points)  

If you have the Grapevine homework, the reason why you can't run two instances I think is that you try to use the same port number in each code ("8989" by default). If you change this in your code to listen on different port at every run (eg. get the port number from parameter), you will be able to run as many instances as you like.

commented May 8, 2016 by Petrosz1991 (40 points)  
edited May 8, 2016 by Petrosz1991
Not that the problem, I give the port number as parameter. When I get the CIM instances it returns all the instances and even could filter, but when I try to use the method of an instance it will run, but it seems as if it try to call another instance method too.
Eg.
Two instance: 6666, 8888 I try to run StopServer on 6666. It will stop the server, but instance 8888 will collapse.
commented May 8, 2016 by selton (25 points)  
Do you set up a unique key for the  WMI instance? (At the sample GuessGame, they call it SessonName)
commented May 8, 2016 by Petrosz1991 (40 points)  
Yes I done it. It is called InstanceID. The [ManagementKey] was also added to it.
commented May 8, 2016 by selton (25 points)  
hátakkornemtudom :D
commented May 8, 2016 by Petrosz1991 (40 points)  
Köszi, megtaláltam a segéd anyagban, az előfordulható hibák között. Sajnos nincs ajánlott megoldás. :D
...