Hellos to everyone I have a beginner question:
My GoDaddy Linux server has an online SQL database table with 1 field ascii data only, that is being updated periodically
I just want to develop a Windows/Mac application using Xojo, to SELECT (obtain data) from this specific field, with minimum delay possible once it’s updated (I mean, within a second or less interval)
Which is the best way to do this ? I have no idea whether websockets is a better solution rather than using basic SQL queries every 500ms or so.
I have tested outputting the field contents in to a HTML page and using HTML5 server side events, but it’s too slow and unstable, plus it stops working suddenly.
I look forward to obtaining any advice from you guys
You could write a php script that grabs the data and displays it as a “page” - no html, just the one piece of data unadorned. Then use an httpsocket pointed at the php script url to retrieve the data.
Mmm what about a Xojo Web App running on your hosted Server communicating via JSON or XML with your Desktop App. I can’t say if this is a faster solution (I think it’s slower than with simple PHP) but it would be better to develop and maintain.
Tim, what about Ddos attack vulnerabilities ?
Tomas, I never thought about that and will start my documentation hunting process
Maybe the fastest solution without any interpreted PHP or compiler Xojo WebApp could work like this:
Each time you update your DB a simple XML File is created which your latest data.
Now your Desktop may fetch and parse this XML with XmlDocument Object Class.
Dim MySocket as new HTTPSocket
Dim XMLDom As new XmlDocument
Dim ServerAddress as String = "http://yourservername.com/"
Dim XMLFile as String = "anyfilename.xml"
XMLDom.LoadXML(DefineEncoding(MySocket.Get(ServerAddress + XMLFile, 10), Encodings.UTF8))
Thanks Tomas, I think that’s downloading a file from the server, which in my case will do it twice a second but that will do the trick