DNS-SD with mergeBonjour and rresocket?

JOHN PATTEN johnpatten at me.com
Fri Dec 21 16:05:38 EST 2012


Thanks Monte!

I've made more progress.

I now can register a Bonjour service using the following:

on mouseUp
   put "shell(" & quote & "dns-sd -R 'LiveCode-Bonjour' _jplivecode._tcp . 5601 " & quote & ")" into pAdvertiseBonjourService
   open process pAdvertiseBonjourService
   --put the result
end mouseUp

I have not figured out how to use close process to de-register the Bonjour service. I could not find any shell script that took the service down and off the bonjour list? 

I also have mergeBonjour working to discover the new registered service in the iOS simulator, so far so good.

My next step is to open a socket on the desktop app with the correct port, just like normal: 

  open socket to "localhost:5600"
  if the Result <> "" then
  put "result:" && the result
              end if

Then to use the rresocket external to open a connection on the iOS device, and write the data/text out to the open port on the desktop app.  Not sure what to make about the read me in the rresocket folder? Not sure what "Tail commands" are and the demo that is included appears to be broken.

What would the rrsecocket commands look like on my iOS app to open a connection to my desktop app and then write out some data to that desktop app?

Thank you!

John Patten
SUSD


On Dec 20, 2012, at 4:45 PM, Monte Goulding <monte at sweattechnologies.com> wrote:

> Hi John
> 
> try open process to register and close process to de-register.
> 
> In theory you are meant to register a service type here:
> http://www.dns-sd.org/ServiceTypes.html
> 
> rresocket would be tcp. The service type is very important. You browse for a service type, select one based on the name (which is usually the device/computer name) and then use it's ip.
> 
> Cheers
> 
> Monte
> 
> On 21/12/2012, at 11:31 AM, JOHN PATTEN wrote:
> 
>> Hi All…
>> 
>> Managed a little victory this afternoon with figuring out how to use a shell script in LC to register a Bonjour service. At least how to start the service. Not sure how to close it once it's started though.  This is what I discovered…
>> 
>> on mouseUp
>>  answer shell("dns-sd -R 'LiveCode-Bonjour' _http._tcp . 80 ")
>> end mouseUp
>> 
>> I'm using a little app that browses the network for Bonjour services, and I see my new "LiveCode-Bonjour" service listed under the http group.  However, because I used "answer" in front of the shell script, my stack locks up apparently waiting to answer. I can "command-period" out but I'm guessing I should have used a get or a put and I would not have locked up my stack? I can't test his out because once I've registered a Bonjour services with my stack, I can't figure out how to cancel the service and eliminate LiveCode-Bonjour from the list of available Bonjour services? Is there another shell script I can use to cancel the Bonjour service I just registered?
>> 
>> 
>> So after I learn how to stop Bonjour service, which protocol should I use to restart the service if I'm planning on using rresocket? Is it just _workstation_udp. and the port of my choice? I'm assuming I wouldn't be using http and 80 if I'm planning to use rresocket for the iOS to send text/data to the desktop app? However if all I need is the IP why would it matter? Or is the Bonjour type that i register animportant (workstation_udp & port) component for getting rresocket to work?
>> 
>> Thanks in advance!
>> 
>> John Patten
>> SUSD
>> 
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> --
> M E R Goulding 
> Software development services
> Bespoke application development for vertical markets
> 
> mergExt - There's an external for that!
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list