Re: How to stop listening on a port?
Re: How to stop listening on a port?
- Subject: Re: How to stop listening on a port?
- From: Malte Tancred <email@hidden>
- Date: Tue, 12 Nov 2002 08:16:06 +0100
On monday, nov 11, 2002, at 23:05 Europe/Stockholm, John Anderson wrote:
Oh, I think I see the problem then. I was getting the socket from the
acceptance notification. So what I need to close is the original
listening socket.
Right.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(gotConnection:)
name:NSFileHandleConnectionAcceptedNotification
object:myNewtonFileHandle];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(dataReceived:)
name:NSFileHandleReadCompletionNotification > object:myNewtonFileHandle];
Also, you probably don't want the second line. The read completion
notification should be registered for the client socket given to you by
the accept notification.
I don't think registering for read completions on the listening socket
serves any purpose. I might be wrong of course.
Cheerio,
Malte
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.