Page 1 of 1
A kind of remote control
Posted: Tue Jul 08, 2008 1:38 am
by bjb007
I would like the user to be able to send the
clicks to other Rev programmes from this...
Are there any niftier ways than writing to
a file then having the other prog. read from
there? Just needs the number on the button.
Posted: Tue Jul 08, 2008 5:23 am
by Janschenkel
One option is read/writing a shard file, as you mentioned. Another option is socket communication, where you setup a server application that gets the message, handles it and maybe send a result back to the client application.
Are you developing both applications?
Jan Schenkel.
A kind of remote control
Posted: Tue Jul 08, 2008 5:45 am
by bjb007
Jan
I'd like to connect to a number of
apps which I have written.
When you mention "server" I expect
you mean the one on the users computer?
Don't know much about them except
"128.0.0.1" (I think).
Posted: Tue Jul 08, 2008 9:05 am
by Garrett
Rev isn't capable of sending keystrokes to other applications, regardless if they're rev apps you made or not.
So tcp/ip communications is probably the best option.
A kind of remote control
Posted: Tue Jul 08, 2008 9:16 am
by bjb007
Garrett
Just has to send the number on the
button and have the receiving prog
do a "mouseUp" with it.
Posted: Tue Jul 08, 2008 12:51 pm
by Janschenkel
In RevOnline there is a pair of example stacks for TCP/IP communicaztion that you can take apart and learn from.
RevOnline > User Spaces > Browse by category > Programming : TCP App 1 and 2
Hope this helped,
Jan Schenkel.
A kind of remote control
Posted: Tue Jul 08, 2008 3:15 pm
by bjb007
Thanks Jan. Seems to be just
the thing.
I guess then that the receiving prog.
uses "read from socket"?
And to send info to more than one prog
I'd need a list and send to them in
rotation?
Is there a way to detect which progs are
running?
Posted: Tue Jul 08, 2008 7:35 pm
by Janschenkel
That could be done through 'shell' function calls to check the running processes, but this approach would be quite platform-specific.
It may be a lot easier to just write a file in a shared directory, with a preset extension, which contains the name of the application and the port on which you can contact it.
And even then, you should check the socketTimeOut options, just in case your other application closed without cleaning up its reference file. Also take a look at the 'specialFolderPath' function to determine a good spot to write those files.
Hope this helped,
Jan Schenkel.