• 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: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?


  • Subject: Re: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?
  • From: Jonathan Hendry <email@hidden>
  • Date: Mon, 01 Mar 2010 18:15:03 -0500

Checking on my lsof -i suggestion now that I'm at work...

I just set up a screen sharing session from my laptop to another machine.

lsof -i on my laptop produced the following output:

AppleVNCS 19770 jon 5u IPv6 0x69d9b2c 0t0 TCP *:vnc-server (LISTEN)
AppleVNCS 19770 jon 6u IPv6 0x69d85a8 0t0 TCP dhc016942.med.harvard.edu:vnc-server->blur.med.harvard.edu:49152 (ESTABLISHED)
Screen 19773 jon 4u IPv4 0x77a6270 0t0 TCP dhc016942.med.harvard.edu:64931->blur.med.harvard.edu:vnc-server (ESTABLISHED)


I didn't have to run lsof as root.

After ending the screen sharing session on the remote computer, lsof - i on my mac produces this output:

AppleVNCS 19770 jon 5u IPv6 0x69d9b2c 0t0 TCP *:vnc-server (LISTEN)

The AppleVNCS 'ESTABLISHED' socket is gone, as is the 'Screen' process and its socket, leaving just the screen sharing listening socket.

Apparently the screen-sharing processes run as whoever is logged in at the console.

If you want to find out if there's an active VNC session in progress, this appears to be a reasonable lead on how to do it, although it won't tell you who's controlling the computer at a given time or let you distinguish remote input from local input.
_______________________________________________


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: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?
      • From: Joe Jones <email@hidden>
References: 
 >Re: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session? (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: [NSString characterAtIndex:] -> [NSString stringWithCString:encoding:]
  • Next by Date: RE: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?
  • Previous by thread: Re: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?
  • Next by thread: RE: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?
  • Index(es):
    • Date
    • Thread