Jump to content

VBScript channelchange.vbs Timeout Error


oOp

Recommended Posts

Hallo,

 

ich habe in meiner channelchange.vbs code einprogrammiert, welcher bei bestimmten sendern

ein http request macht.

 

Es funktioniert auch allles wunderbar, nur leider erhalte ich ab und an Timeout errors vom DVBViewer.

 

Siehe http://yfrog.com/0oscripttimeoutj

 

Die Einstellungen in Optionen - Scripts - Timeout scheinen keine Auswirkungen zu haben.

 

Ist dies eventuell irgendwo anders einzustellen?

 

Danke im voraus.

 

Edit: Elaube ich Windows Dialos Boxen, so erhalte ich ein Popup: http://yfrog.com/be57278856j

Edited by oOp
Link to comment

Kannst Du das Script bitte mal hier posten, oder zumindest den relevanten Teil mit den HTTP-Requests?

Link to comment
sub main(aID)

dim URL
dim Http
dim Res

Dim myFSO, objFile
Dim myFSO2, objFile2

Dim S
Dim DEBUG

DEBUG = "OFF"

'On error resume next

Set objDictionary = CreateObject("scripting.dictionary")
objDictionary.Add "3", "Arte SD"
objDictionary.Add "0", "Eins Extra"
objDictionary.Add "1", "Eins Festival"
objDictionary.Add "2", "Eins Plus"
objDictionary.Add "224", "Das Erste HD"
objDictionary.Add "225", "ZDF HD"

Set objDictionary2 = CreateObject("scripting.dictionary")
objDictionary2.Add "659", "DMAX"
objDictionary2.Add "982", "LuxeTV SD"
objDictionary2.Add "955", "Tele5"
objDictionary2.Add "462", "Nick"

Set objDictionary3 = CreateObject("scripting.dictionary")
objDictionary3.Add "226", "Arte HD"
objDictionary3.Add "206", "Anixe HD"
objDictionary3.Add "207", "Astra HD"


Set myFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = myFSO.OpenTextFile("channel.txt", 1)
S=objFile.ReadLine
objFile.Close
SET objFile = NOTHING
SET myFSO = NOTHING

Dim S2, aID2
S2 = Cstr(S)
aID2 = Cstr(aID)

Set myFSO2 = CreateObject("Scripting.FileSystemObject")
Set objFile2 = myFSO2.OpenTextFile("channel.txt", 2, True)
objFile2.Write aID
objFile2.Close
SET objFile2 = NOTHING
SET myFSO2 = NOTHING

if (objDictionary.Exists(S2) And objDictionary.Exists(aID2)) Then
if DEBUG="ON" THEN MsgBox 1 END if
	SET objDictionary = NOTHING
SET objDictionary2 = NOTHING
exit sub
end if
if (objDictionary2.Exists(S2) And objDictionary2.Exists(aID2)) Then
if DEBUG="ON" THEN MsgBox 2 END if
SET objDictionary = NOTHING
SET objDictionary2 = NOTHING
exit sub
end if
if (objDictionary3.Exists(S2) And objDictionary3.Exists(aID2)) Then
if DEBUG="ON" THEN MsgBox 2 END if
SET objDictionary = NOTHING
SET objDictionary2 = NOTHING
exit sub
end if

if (objDictionary2.Exists(S2) = False And objDictionary2.Exists(aID2) = False And _
objDictionary.Exists(S2) = False And objDictionary.Exists(aID2) = False And _
objDictionary3.Exists(S2) = False And objDictionary3.Exists(aID2) = False) Then
if DEBUG="ON" THEN MsgBox 4 END if
SET objDictionary = NOTHING
SET objDictionary2 = NOTHING
exit sub
end if

if objDictionary.Exists(aID2) Then
if DEBUG="ON" THEN MsgBox 5 END if
URL = "http://192.168.X.X/control/zapto?41b00017034"
else
if objDictionary2.Exists(aID2) Then
if DEBUG="ON" THEN MsgBox 6 END if
	URL = "http://192.168.X.X/control/zapto?44400012775"
else
	if objDictionary3.Exists(aID2) Then
if DEBUG="ON" THEN MsgBox 7 END if
		URL = "http://192.168.X.X/control/zapto?41b00017032"
	else
if DEBUG="ON" THEN MsgBox 8 END if
		URL = "http://192.168.X.X/control/zapto?44d00016dca"
	end if
end if
end if

Set Http=CreateObject("WinHttp.WinHttpRequest.5.1") 
'Http.SetTimeouts 1,1,1,1
Http.Open "GET", URL, False 
Http.Send 

SET Http = Nothing
SET objDictionary = NOTHING
SET objDictionary2 = NOTHING
end sub

Link to comment

Mhm der DVBViewer mag wohl keine zulangen Skripte.

1. Möglichkeit: externes Skript über die channelchange.vbs aufrufen, Aktionen durchführen und über den Com-Server mit dem DVBViewer kommunizieren.

2. Möglichkeit: Die Laufzeit deines Skripts optimieren - ob man dabei soviel rausholen kann ist aber fraglich (vielleicht: switch ... case ... endswitch oder if ... elseif ... endif anstatt ständig if ... endif?)

 

3. Möglichkeit: bei einer bestimmten Zeitüberschreitung das Skript beenden.

Link to comment
Mhm der DVBViewer mag wohl keine zulangen Skripte.

1. Möglichkeit: externes Skript über die channelchange.vbs aufrufen, Aktionen durchführen und über den Com-Server mit dem DVBViewer kommunizieren.

2. Möglichkeit: Die Laufzeit deines Skripts optimieren - ob man dabei soviel rausholen kann ist aber fraglich (vielleicht: switch ... case ... endswitch oder if ... elseif ... endif anstatt ständig if ... endif?)

 

3. Möglichkeit: bei einer bestimmten Zeitüberschreitung das Skript beenden.

 

Ich denke, Möglichkeit 1 ist die richtige. Ein externes Script asynchron aufgerufen, d.h. das aufrufende wartet nicht auf die Beendigung. Sollte klappen. Man müsste wohl auch nur den HTTP-GET-Request auslagern, da der am zeitkritischsten sein sollte.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...