URL "get" from a local IP router address machine

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm

URL "get" from a local IP router address machine

Post by churchken » Wed Oct 07, 2009 8:49 pm

Hi, folks.

Thanks in advance for any possible help.

Without using sockets, can URL "get" a file from another computer on the same router? There is not actually a server involved, nor an outside www. address. What would the syntax be?

For example, REV on machine 127.0.0.1, router IP of 192.168.1.100, wants to get file "c:test.txt" from machine 192.168.1.101 on same router. Is there a form of "http" or "ftp" that would work?

Thanks for any ideas.
Ken

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Post by FourthWorld » Wed Oct 07, 2009 8:56 pm

Rev doesn't care what IP it's being asked to use. I've used local addresses without difficulty. What happened when you tried it?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Philhold
Posts: 64
Joined: Thu Mar 05, 2009 3:39 pm

Post by Philhold » Wed Oct 07, 2009 9:14 pm

Hi Ken,

http works on a web server so you need to have the file in the web hierarchy and have the server running then this will get it.

get URL "http://192.168.1.101/test.txt"

If you want to use ftp you similarly have to have an ftp server running and have the file in an ftp accessible directory.

get URL "ftp://192.168.1.101/test.txt"

I don't think that RunRev uses sfs (Windows simple file sharing) or afp (the Apple equivalent) so I suspect that unless you have a server running you will not be able to access a file on another machine on the same router.

I realise that this may not answer your question but at least it might help you narrow things down.

Cheers

Phil

churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm

Post by churchken » Wed Oct 07, 2009 9:37 pm

Thanks, Richard & Phil,

Yes, if the target machine has a server running, things work fine to use either of the approaches mentioned.

My hope was that some faster file sharing (without a server connection) might be possible. For this particular application, the objective is to move a data file from a RAM drive on 1 machine, directly into a REV field app on the other.

Thanks for your input.
Ken

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Thu Oct 08, 2009 5:56 am

Is there some reason you don't want to use sockets for this? That seems to fit the bill perfectly for what you want to do, and you'd be hard-pressed to find anything faster.

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Post by Garrett » Thu Oct 08, 2009 3:58 pm

Sounds more like he's looking at network shares here which using http will not work with. It will require network paths instead of internet paths, provided the other machine has a network share open.

I believe this would be the proper way here:

get URL "\\johndoe-desktop\sharedfiles\test.txt"

But I'm honestly not sure this is correct or not as I have not done any network coding with Rev.
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)

churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm

Post by churchken » Thu Oct 08, 2009 4:57 pm

Thanks for the ideas.

I had originally intended to use sockets, but was not sure about "sending" a message that was so large -- the file size might be an issue. And that would involve running another REV socket program on the file side to use for the send.

However, since file sharing may work, let me test both approaches on the large files and see how it goes.

I'll post back once the better solution is confirmed.

Thanks again.
Ken

churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm

sockets win !

Post by churchken » Mon Oct 12, 2009 2:21 pm

Thanks to all who made suggestions.

The better solution seems to be using sockets to send and receive the data files.

Size of the data files did not prove to be an issue, and the transfers work seamlessly. Running "tiny" REV programs to handle the socket communications is simpler than "network shared files" and faster than http or ftp with a server.

Regards,
Ken

Post Reply