Rank: Advanced Member
Groups: Registered
Joined: 10/14/2016(UTC) Posts: 64 Location: Sheffield
|
Hi all, hopefully someone can help here. We have a script to control a bunch of stuff on the main show PC and a secondary PC as well. Sadly it seems that we hit some kind of buffer with the commands to the secondary PC. If I hit the button a few times it then goes to "running" and won't continue doing anything. The script is:
Dim client = WebRequest.create("http://10.0.0.4:8088/API/?Function=MultiViewOverlayOn&Input=1&Value=1") Dim response = client.GetResponse() response.Close sleep(100) Dim client1 = WebRequest.create("http://10.0.0.4:8088/API/?Function=MultiViewOverlayOff&Input=1&Value=2") Dim response1 = client1.GetResponse() response.Close sleep(100) Dim client2 = WebRequest.create("http://10.0.0.4:8088/API/?Function=MultiViewOverlayOff&Input=1&Value=3") Dim response2 = client2.GetResponse() response.Close
I put the "sleeps" in to try and reduce the burden but to no avail.
Ideas on a postcard please!!
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/14/2016(UTC) Posts: 64 Location: Sheffield
|
I'm assuming nobody has an answer for this one...
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/28/2015(UTC) Posts: 183
Thanks: 10 times Was thanked: 32 time(s) in 27 post(s)
|
Does it help not closing 3 times "response"?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/14/2016(UTC) Posts: 64 Location: Sheffield
|
As the script stands it just locks it up after a couple of starts
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 2/23/2019(UTC) Posts: 552
Thanks: 62 times Was thanked: 128 time(s) in 117 post(s)
|
Originally Posted by: nomski As the script stands it just locks it up after a couple of starts I think pm means, that you are closing 'response' three times, but 'response1' and 'response2' not at all.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/14/2016(UTC) Posts: 64 Location: Sheffield
|
For example, this is a good test script for it: Dim client = WebRequest.create("http://10.0.0.53:8088/API/?Function=OverlayInput1In&Input=1") Dim response = client.GetResponse() response.Close sleep(1000) Dim client1 = WebRequest.create("http://10.0.0.53:8088/API/?Function=OverlayInput1Off") Dim response1 = client1.GetResponse() response.Close sleep(1000) Dim client2 = WebRequest.create("http://10.0.0.53:8088/API/?Function=OverlayInput1In&Input=1") Dim response2 = client2.GetResponse() response.Close sleep(1000) Dim client3 = WebRequest.create("http://10.0.0.53:8088/API/?Function=OverlayInput1Off") Dim response3 = client3.GetResponse() response.Close
If you run this a couple of times, it breaks. You can then wait a few minutes and it starts working again. Very odd!
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/14/2016(UTC) Posts: 64 Location: Sheffield
|
Originally Posted by: dmwkr Originally Posted by: nomski As the script stands it just locks it up after a couple of starts I think pm means, that you are closing 'response' three times, but 'response1' and 'response2' not at all. I see. I'll give that a go.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,220 Location: Belgium Thanks: 291 times Was thanked: 953 time(s) in 788 post(s)
|
Assume you are trying it with a webrequest because you are controlling another computer as else you just could use the APi.Functions?
Webrequests do take some time to finish (if at all) , have you tried one at a time ( step by step debugging) and trying not to start the script again before being shure it has executed completly ?
Always a good idea to build in error traps within a script !
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/14/2016(UTC) Posts: 64 Location: Sheffield
|
Yes, controlling another PC. It seems that it's a rate of request thing that does it. If I just do one command it works. If I then bash the one command script a bunch of times, it breaks. If I have 3 or more web requests it breaks. It still responds if you run the same web request from a browser though which seems odd!
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/14/2016(UTC) Posts: 64 Location: Sheffield
|
SORTED!! Thanks so much. It was the not closing the responses correctly. Happy days!! That was driving me nuts.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close