X11 显示数字有多高? [英] How high do X11 display numbers go?

查看:38
本文介绍了X11 显示数字有多高?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

displayno 是 X11 显示名称的一部分.

The displayno is part of the X11 display name.

我看过几个定义,解释它是一个从 0 向上的数字,但我没有看到任何解释是否有最大显示数字的文档.

I have seen several definitions that explain it is a number from 0 upwards, but I haven't seen any documents that explain if there is a maximum display number.

最高显示数是多少?在哪里定义的?

What is the highest display number? Where is it defined?

这个问题的背景是我想了解PyVirtualDisplay的Display number分配算法.我还没有理解/tmp/.X*lock文件的作用,但看起来分配例程会选择总是增加显示数字,这表明在重复调用的某个阶段可能会达到极限并崩溃,特别是如果它很小.

The background for this question is that I am trying to understand the Display number allocation algorithm of PyVirtualDisplay. I haven't understood the role of the /tmp/.X*lock files yet, but it looks like the allocation routine will choose always increasing display numbers, suggesting at some stage of repeatedly being invoked it might hit the limit and fall over, especially if it is small.

推荐答案

简短的回答:没有很好的定义.

Short answer: it's not well defined.

更长的答案:这取决于您碰巧使用的流协议.在 TCP 中,它恰好被简单地添加到 6000 的基本端口号,这意味着服务器将无法在显示号 59535 附近的某个地方启动.在 unix 域套接字上,它只是一个整数附加到 /tmp/下的套接字名称.X11-unix(所以如果你用 -nolisten tcp 启动服务器,你可以有几十亿左右).在 DECnet 中......好吧,我不知道,但如果你发现自己处于需要关心的情况,我很抱歉.

Longer answer: it depends on the stream protocol you happen to be using. In TCP it happens to be simply added to the base port number of 6000, which means the server will fail to launch somewhere around display number 59535. Over unix domain sockets it's just an integer appended to the socket name under /tmp/.X11-unix (so if you're launching the server with -nolisten tcp you can have a few billion or so). In DECnet... well, I don't know, but if you ever find yourself in a situation to care, I'm very sorry.

对于后代来说可能更好的答案:如果您使用的是足够新的 X 服务器,您可以使用 -displayfd <n> 参数告诉服务器简单地选择 一个可用的显示编号,然后在该文件描述符上将其写回给您.认为这是 xserver 1.13 中的新功能,应该会在 2012 年末发布.

Possibly better answer for posterity: if you're using a sufficiently new X server, you can use the -displayfd <n> argument to tell the server to simply pick an available display number, and write it back to you on that file descriptor. Think that's new in xserver 1.13, which should be out late 2012.

这篇关于X11 显示数字有多高?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆