Re: OTListen in OS 9
Re: OTListen in OS 9
- Subject: Re: OTListen in OS 9
- From: Lyndsey Ferguson <email@hidden>
- Date: Tue, 13 May 2003 09:15:58 -0400
Well this is a a client/server program. The client side sends out a
broadcast with a port number as the message. The matching servers on the
intranet use this port number to connect to the listening endpoint on the
client. The server connects to the client and gives it information. This
broadcast is repeated intermittently (15mins) by the client to test for
information.
The server is in one preemptive thread and the client on another.
On the server there is a listening endpoint that creates a endpoint to
respond to the broadcasts. When the information is passed on to the client,
the created endpoint is closed.
On the client, there are two endpoints that stick around. One for
broadcasting the message and the other for receiving the connection from the
server. Once we receive a connection request, an endpoint is created and the
connection is accepted on the created endpoint. Once it is complete, that
temporary endpoint is closed.
In my wrapper class's "close" function, I currently CancelSynchronousCalls,
then close the provider. This is sometimes in the main thread, not the
client thread or the server thread. This gives me the OTCanceledErr in the
server or client thread and I throw an exception to get to the end of the
thread.
I have just read that I also should be unbinding as well to be able to reuse
things properly. At this point I am uncertain where to place this, in my
"close" function after I cancel? Or should I create a separate function in
my wrapper to "cancel" even though on the windows side the socket is just
closed. I guess these are points I can settle, but advice is always welcome.
After each endpoint is closed, I delete the class wrapper. The endpoint is
no longer available.
Previously for every endpoint that I closed, I was not sending an error
message to the cancel synchronous calls. And now I realized that I have not
been unbinding these endpoints, so I am not reusing endpoints and I notice
in tcpdump that the port numbers are steadily increasing (not being reused).
Anyway thanks for your help. Just a note of exuberance: network and
multithreaded programming is so much fun! And I thought I wanted to be a
graphics only guy after University!
Lyndsey
On 5/13/03 3:52 AM, "Quinn" <email@hidden> wrote:
>
At 8:48 -0400 9/5/03, Lyndsey Ferguson wrote:
>
> It seems to have solved that problem, but I don't want to stamp "bug
>
> fixed" on this one until I'm sure.
>
>
I understand this sentiment. The reason OTMP asserts that errParam <
>
noErr is that OTMP stores the errParam in mpEP->cancelErr (in
>
CancelAction) so that all subsequent operations fail with that error.
>
If errParam was noErr, those operations would not fail, which is
>
probably bad.
>
>
To understand this further I need to know the exact sequence of
>
events. Which endpoint are you cancelling and what do you do with
>
that endpoint afterwards?
>
>
S+E
--
Lyndsey D. Ferguson
Software Engineer
Nemetschek N.A., Inc.
email@hidden
--
_______________________________________________
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.