Re: how to find out what port the X server is listening on?
Re: how to find out what port the X server is listening on?
- Subject: Re: how to find out what port the X server is listening on?
- From: Bill Janssen <email@hidden>
- Date: Thu, 30 Jan 2014 11:07:30 -0800
- Comments: In-reply-to Brandon Allbery <email@hidden> message dated "Thu, 30 Jan 2014 10:38:55 -0800."
Brandon Allbery <email@hidden> wrote:
> On Thu, Jan 30, 2014 at 1:33 PM, Bill Janssen <email@hidden> wrote:
>
> > Still haven't figured out how to find out what port the X server is
> > listening on without resorting to some awful heuristics.
> >
>
> I think your best bet might be `lsof -a -i -c Xquartz`.
Like I said, awful heuristics :-). But it also doesn't work:
% netstat -a -n | grep 6000
tcp4 0 0 13.4.8.84.6000 13.1.100.21.34858 ESTABLISHED
tcp4 0 0 13.4.8.84.6000 13.1.100.119.55983 ESTABLISHED
tcp4 0 0 13.4.8.84.6000 13.1.100.21.57054 ESTABLISHED
tcp4 0 0 13.4.8.84.6000 13.1.100.21.57051 ESTABLISHED
tcp4 0 0 13.4.8.84.6000 13.1.102.103.50274 ESTABLISHED
tcp4 0 0 *.6000 *.* LISTEN
tcp6 0 0 *.6000 *.* LISTEN
181de534 stream 0 0 0 19926000 0 0 /tmp/launch-dCgXFc/org.macosforge.xquartz:0
19926000 stream 0 0 0 181de534 0 0
% lsof -a -i -c Xquartz
%
I find it hard to believe that even if I can talk directly to the X
server via the X11 protocol, that there's no way for it to tell me what
port it's listening on. I'd even be willing to use AppleScript :-).
Of course, the DISPLAY variable could track the port # properly, too,
just as a convenience to the user. Then I could pull it off of that.
Bill
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden