• 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: OT: socket question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT: socket question


  • Subject: Re: OT: socket question
  • From: Andrei Tchijov <email@hidden>
  • Date: Thu, 27 Apr 2006 14:50:57 -0400

from command line it is easy

	lsof

But programmatically ... definitely possible. I wonder if lsof is part of Darwin (so you can take a look into the source)

On Apr 27, 2006, at 2:47 PM, Ondra Cada wrote:

Oh, this

... I need a way to determine whether the ... application is running or not

reminded me of a problem I have, so I boldly dare to ask even if it is not quite Cocoa-specific (sorry, but I bumped into it in a full- Cocoa app, which uses exclusively NSFileHandle to operate sockets :))


Is there a way in Mac OS X to get the PID of the other side of a socket? The socket is a local AF_UNIX, thus the question makes sense: if the connection runs, there is bound to be a local peer process (which I might need to kill if it sends garbage over the socket, and that's why I am trying to find the PID). Though, I haven't found any solution yet (google provided a number of linux hacks, and that's all).
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Design question (From: "Marcus S. Zarra" <email@hidden>)
 >OT: socket question (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: NSNumberFormatter and localized format problem
  • Next by Date: Re: Progress Bar while Reading a File
  • Previous by thread: OT: socket question
  • Next by thread: NSActionCell mouseEntered crashes application
  • Index(es):
    • Date
    • Thread