Re: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?
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: Ken Ferry <email@hidden>
- Date: Mon, 1 Mar 2010 15:45:22 -0800
If you are going to look at stuff like that, please make sure your
application is still usable if it stops working. You're looking at
implementation details, not API. They can break between OS releases.
-Ken
On Mon, Mar 1, 2010 at 3:16 PM, Joe Jones <email@hidden> wrote:
> Great, thanx!
>
> From: Jonathan Hendry [mailto:email@hidden]
> Sent: Monday, March 01, 2010 3:15 PM
> To: Joe Jones
> Cc: email@hidden Developers
> Subject: Re: Is there any Cocoa API (or other way) to determine if an
> application is running in a VNC or ARD session?
>
> 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
>
_______________________________________________
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