![为什么 LAN 上的 XEmacs gnuclient 会超时?](https://linux22.com/image/1445740/%E4%B8%BA%E4%BB%80%E4%B9%88%20LAN%20%E4%B8%8A%E7%9A%84%20XEmacs%20gnuclient%20%E4%BC%9A%E8%B6%85%E6%97%B6%EF%BC%9F.png)
我在主机 A 上运行着 XEmacs(和 gnuserv)。我从主机 B 上的 bash 启动 gnuclient,但出现超时(strace 输出结束见下文)。两个主机都在 $GNU_SECURE_FILE 指向的文件中。这是在 LAN 上,我以前在不同的 LAN 上从未遇到过问题。
connect(3, {sa_family=AF_INET, sin_port=htons(46602), sin_addr=inet_addr("172.20.9.11")}, 16) = -1 ETIMEDOUT (Connection timed out)
dup(2) = 4
fcntl(4, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(4, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 15), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcf4396c000
lseek(4, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(4, "gnuclient: Connection timed out\n", 32gnuclient: Connection timed out
) = 32
close(4) = 0
munmap(0x7fcf4396c000, 4096) = 0
write(2, "gnuclient: unable to connect to "..., 39gnuclient: unable to connect to remote
) = 39
exit_group(1) = ?
答案1
超时的原因是主机 B 上的显示设置不正确。$DISPLAY
必须将环境变量设置为主机 A 的显示。