[MacRuby-devel] Trying to add Bonjour to a ControlTower app

Laurent Sansonetti lsansonetti at apple.com
Tue Dec 14 15:13:10 PST 2010


Hi Mark,

I'm afraid the low level BSD socket structures are not yet covered by BridgeSupport.

We could eventually add them to the libSystem BridgeSupport file, however I wonder if there isn't an easier way to use Bonjour from MacRuby.

Laurent

On Dec 12, 2010, at 8:09 PM, Mark Rada wrote:

> Hi,
> 
> For a distributed web service I am trying to add Bonjour support, but I ran into trouble with the Bridge Support when trying out one of the examples from the NSNetServices Programming Guide[1].
> 
> When publishing, I am supposed to get some socket info from a BSD sockaddr structure[2], but I can't seem to cast the Pointer object to something useful. For example, when I try asking the Pointer for its type I get this:
> 
> 	NSSocketPort.alloc.init.address.bytes.type # => "C"
> 
> But it should be a struct with a short int and a char array. If I try to case the Pointer I get an error:
> 
> 	NSSocketPort.alloc.init.address.bytes.cast!( '{sockaddr=s[c]}' )
> 
> 	TypeError: unrecognized runtime type `{sockaddr=s[c]}' 
> 
> I cannot find a Boxed class descendant for sockaddr or any of the structs it is unionized with, so I am wondering if anybody else has tried the Bonjour examples with MacRuby and had success? Are these low-level BSD libraries supported by the new Bridge Support?
> 
> Thanks,
> 	Mark
> 
> Links:
> 1. http://developer.apple.com/library/mac/#documentation/Networking/Conceptual/NSNetServiceProgGuide/Articles/PublishingServices.html
> 2. http://www.delorie.com/gnu/docs/glibc/libc_305.html
> 
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20101214/5d9e0587/attachment.html>


More information about the MacRuby-devel mailing list