My app connects to YouTube. I have this code in to test if the user has access to the internet so it can work. One user is getting this “Error code: 0” despite having a valid internet connection. He is running Windows 10. I had him check his firewall settings and he did so and said he had no virus protection including Windows Defender (yikes), so I’m wondering why he might be getting this error? Works fine for others.
[code] data = socket1.Get(newURL, 30)
if data <> “” then
// user has an internet connection
else
if socket1.lastErrorCode <> 0 then
msgBox "Error code: “+ str(socket1.ErrorCode)+ " - A connection to YouTube was not able to be established. Check your internet connection and try again.”
return
end if
end if[/code]
Is there a better way of checking? Got the code from a search. I could try commenting that out and seeing if it runs for him. May be returning a false positive?
He might be in a location that has youtube blocked, however I would expect some data to be returned but it might be timing out and not being caught by your msgbox because of the above post.