I’ve mentioned in the past that if I am unable to connect to a mySQL server (such as going to a location with my laptop and finding their firewall blocks port 3306) it takes close to a minute for LC to release and tell me it cannot connect. During that time LC is completely unresponsive. I needed a way to check first if I can make that connection. I came up with a solution using open socket:
put “mySQLServer.myhost.com:3306|mySQL” into theSocket open socket to theSocket with callback “isConnected" wait for messages put the openSockets into theOpenSockets if theSocket is in theOpenSockets then close socket theSocket -- move along. Nothing to see here else -- alert the user. Maybe even put a repeat loop around the whole thingummy end if on isConnected -- stup handler for the callback end isConnected This is VASTLY superior to waiting for a minute (or whatever the SQL timeout is) until LC responds. Database commands are blocking. Open socket is not. Still unsure why the engine cannot do this as a matter of course. I might put in a feature enhancement. Bob S _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode