• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSConnection does not close ports
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSConnection does not close ports


  • Subject: Re: NSConnection does not close ports
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Thu, 22 May 2008 06:37:17 -0700


On May 22, 2008, at 12:13 AM, Gerriet M. Denkmann wrote:

I have a server, which does create an NSConnection on some NSSocketPort and publishes this fact via Bonjour.
A client opens a connection, sends some messages via Distributed Objects, and closes it again.
This implies opening and closing a few file descriptors on sockets.


Works fine. Usually.

But sometimes some of these socket file descriptors get NOT closed, so they accumulate slowly and when the limit set in limit() is reached, the client blocks forever.

The only way I've been able to get CFMachPorts properly cleaned up from NSConnection is to do


[[connection sendPort] invalidate];
[[connection receivePort] invalidate];
[connection invalidate];

otherwise they appear to stick around forever (until you run out of mach ports). Have you tried something like this with NSSocketPort?

--
adam
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSConnection does not close ports
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >NSConnection does not close ports (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: NSPasteboard Delegate
  • Next by Date: Re: NSTextField will not become editable in a borderless window
  • Previous by thread: NSConnection does not close ports
  • Next by thread: Re: NSConnection does not close ports
  • Index(es):
    • Date
    • Thread