Internet Library Suggestion

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

Locked
SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 239
Joined: Tue Jun 30, 2009 11:15 pm

Internet Library Suggestion

Post by SirWobbyTheFirst » Mon May 26, 2014 4:29 pm

Hey folks, I have a question, would it be at all possible to have the Internet Library merged as part of the regular engine code? Or at least the Load URL and Unload URL code as given that Put URL already exists in the engine and is the blocking kind, I think having the unblocking kind be included and available from the get go would be a nice little addition to the engine. Additionally I think such a change would allow most LC devs to be able to uncheck the Internet Library from the standalone settings box, which for a neat freak like me is like the difference between hot and cold. Haha.

Additionally any thoughts from both users and devs on this idea are welcome, its good to promote discussion.

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Location: Albuquerque
Contact:

Re: Internet Library Suggestion

Post by DarScott » Tue May 27, 2014 1:01 am

I think URL for files is handled by the engine. The last I saw, PUT was not, but that might be new.

I'm all for nonblocking.

The blocking form allows for interesting lines like this:
put processed( URL "http://alpha.com/test" ) into URL "http://beta.com/test"

The nonblocking form, if implemented, might be informed by how the sockets/driver/process model works:

URL GET "http://alpha.com/test" with callback "processAlpha"

I have helped create a 'wait with messages' kind of nonblocking for a dialect of libURL, but that forces completion in the reverse order of requests. I like the callback approach better.

Of coarse, load provides a step in that direction.

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: Internet Library Suggestion

Post by LCMark » Tue May 27, 2014 10:16 am

Whether internet support is in the engine or not depends on the target platform. On mobile / server, the 'url' functions are in the engine (Android uses the Java classes, iOS uses the NSURLConnection classes, Server uses curl). On desktop, the engine sends messages through the message path to handle the internet functions - these are then handled by libURL.

On Desktop:
  • 'put ... into url ...' - sends putUrl
  • 'delete url ...' - sends deleteUrl
  • 'load url ...' - sends loadUrl
  • 'post ... to url ...' - sends postUrl
  • 'url ...' (as in an expression) - sends getUrl
All platforms have non-blocking url operations - 'load url' and 'libUrlDownloadToFile'.

SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 239
Joined: Tue Jun 30, 2009 11:15 pm

Re: Internet Library Suggestion

Post by SirWobbyTheFirst » Sat May 31, 2014 4:13 pm

So would it be possible to have LibURL exist in a stack's script inside the Message Path and still be able to call Load URL? If so that would be fantastic, don't ask me why I would like this, I'm weird and I would only baffle you trying to explain. :oops:

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: Internet Library Suggestion

Post by LCMark » Mon Jun 02, 2014 8:19 am

@mitchpitkin92: If I understand what you are asking correctly - then yes. The libUrl script is in button revLibUrl of stack revLibrary - you can copy this button into a stack and then use 'insert button "revLibUrl" of ... into back" to allow it to be used. The standalone builder does this automatically when building a standalone if you choose to include the 'internet library'.

Locked

Return to “Engine Contributors”