Re: Unbinding an endpoint in OT when running in Classic -- solved.
Re: Unbinding an endpoint in OT when running in Classic -- solved.
- Subject: Re: Unbinding an endpoint in OT when running in Classic -- solved.
- From: Graham Parkinson-Morgan <email@hidden>
- Date: Thu, 15 Apr 2004 14:16:07 -0700
I would not have expected to be penalised for calling OTUnbind before
destroying the endpoint, and indeed, leaving out this call made no
difference.
Quinn's second suggestion, however, did lead to a more fruitful
discovery.
I created a console app, and gradually added in our cross-platform
socket stuff almost line by line until Classic grabbed the port.
I now see what is happening, and have (provisionally, at least) cured
the problem.
The code is set up to have a udpbroadcaster class and a udplistener
class. Each has its own socket/endpoint.
For the broadcaster instance, from what I can gather, even though it is
not 'listening' to a port, it still has to be bound to an address and
port number: the port number defaulted to 0. So OTBind was called with
an address of kOTAnyInetAddress and a port of 0, returning noErr.
Changing the code so that broadcaster objects each got a fresh port
outside the range of privileged ports restored sanity, so now Classic's
port grip of death appears to have vanished.
Thanks for all your input.
Of course my question is, why does OTBind allow binding to port zero,
and, as it turns out, why does it appear to allow binding to port zero
more than once (there can be several 'default' broadcasters). Is there
something magical about port zero, as there is for the address
kOTAnyInetAddress/INADDR_ANY?
Graham
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.