[Openmcl-devel] Publishing a service under Mac OS X (10.6.8 or 10.5.8)

Gary Byers gb at clozure.com
Tue Aug 2 14:47:21 PDT 2011


I likely broke this a year ago. in a series of changes around r14290.

The general idea of those changes was to allow MAKE-INSTANCE and friends
to allow a broader range of initargs when applied to ObjC classes/instances;
some of those initargs can be used to select which ObjC initialization method
to use to allocate the instance, and some of them can be ... well, pretty
much the same way that initargs are used when instantiating other kinds of
objects.

The part of this that tried to determine which initargs could be
combined to determine which initialization method to use apparently
stopped recognizing :init-with-foo as a valid prefix and continued to
recognize :with-foo.  If I'd ever known that :init-with-foo was
supported, I'd long since forgotten; all of the IDE sources use the
:with-foo convention and I think that there had been earlier changes to try
do the keywords->initfunction mapping (without doing a lot of string hacking
at MAKE-INSTANCE time) that only bothered with the :with-foo case.

I was going to say "and the :INIT-WITH-FOO convention isn't even documented",
but of course it is, along with the excruciating details of how to use SEND
to return structures and a bunch of other stuff that's been effectively
deprecated for years.  Chapter 14 of the CCL manual is pretty useless at this
point, and the stuff that should replace it is either scattered around in
other sections (the #/ reader macro) or just plain missing.



On Tue, 2 Aug 2011, R. Matthew Emerson wrote:

>
> On Aug 2, 2011, at 11:51 AM, Keith Erf wrote:
>
>> When running:
>> CCL 1.7 r14926
>> CCL 1.6 r14823
>>
>> The following send statement fails as described.
>>
>> When running:
>> CCL 1.5 r13659
>> The send statement functions as expected (ie publishes the service).
>>
>> (let* ((port 27856)
>>       (the-socket (make-socket :type :stream
>> 			:connect :passive
>> 			:local-port port)))
>>
>> (cond ((not (eql nil the-socket))
>> 	(setf *registration*
>> 		(make-instance 'ns:ns-net-service
>> 		  :init-with-domain #@"local."
>> 		  :type #@"_autopage._tcp."
>> 		  :name #@"Pagination Server"
>> 		  :port port))
>>
>> 	(if *registration*
>> 		(ccl::send *registration* 'publish))))
>
> Instead of :init-with-domain just use :with-domain and it should
> work.  I'm not sure what changed so that we don't like the
> :init-with-foo form any more; it could just be a bug.
>
>
>
>>
>> Under ccl 1.6/1.7 this error occurs:
>>> Error: Objective-C runtime exception:
>>>        *** -[NSNetService publishWithOptions:]: cannot publish an NSNetService created for resolution.
>>
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list