theguywiththefunnyhair
September 8th, 2006, 12:22 AM
Hi,
i have posted this question on the NR forum but since its the same in Girder i thought it cant hurt to ask here as well.
I am trying to use the gip library functions to query a server, i think i have a problem in the way i am trying to use the callback function because the way i have it set up the callback never gets called.
the code i'm using is
function HandleEPGdata(data,code)
if code == 16384 then
NetRemote.SetVariable("Dan.EPG.ConxStatus","Connection Lost") return
end
if code == 32768 then
if data == 0 then
NetRemote.SetVariable("Dan.EPG.ConxStatus","Connection Made")
else
NetRemote.SetVariable("Dan.EPG.ConxStatus","Connection Failed")
NetRemote.SetVariable("Dan.EPG.LastFailure",data)
end
return
end
if code == 1 then
NetRemote.MessageBox(data) return
end
NetRemote.SetVariable("Dan.EPG.ConxStatus","Callback made - no code match")
end;
function OpenEpgServConx()
NetRemote.SetVariable("Dan.EPG.ConxStatus","Open Socket func Executed")
EpgSock = gip.Open("127.0.0.1","1022")
EpgSock:Callback(4, HandleEPGdata)
end;
EpgSock is being created and i have a connection, but as i said my callback function HandleEPGdata() is not being used.
Can anyone see where i have gone wrong?
Thanks
Dan
i have posted this question on the NR forum but since its the same in Girder i thought it cant hurt to ask here as well.
I am trying to use the gip library functions to query a server, i think i have a problem in the way i am trying to use the callback function because the way i have it set up the callback never gets called.
the code i'm using is
function HandleEPGdata(data,code)
if code == 16384 then
NetRemote.SetVariable("Dan.EPG.ConxStatus","Connection Lost") return
end
if code == 32768 then
if data == 0 then
NetRemote.SetVariable("Dan.EPG.ConxStatus","Connection Made")
else
NetRemote.SetVariable("Dan.EPG.ConxStatus","Connection Failed")
NetRemote.SetVariable("Dan.EPG.LastFailure",data)
end
return
end
if code == 1 then
NetRemote.MessageBox(data) return
end
NetRemote.SetVariable("Dan.EPG.ConxStatus","Callback made - no code match")
end;
function OpenEpgServConx()
NetRemote.SetVariable("Dan.EPG.ConxStatus","Open Socket func Executed")
EpgSock = gip.Open("127.0.0.1","1022")
EpgSock:Callback(4, HandleEPGdata)
end;
EpgSock is being created and i have a connection, but as i said my callback function HandleEPGdata() is not being used.
Can anyone see where i have gone wrong?
Thanks
Dan