ckkim@ADAM.KAIST.AC.KR (Kim Chi Kwon) (12/07/90)
I have programmed multi-user talk program. I use motif and X window system for my environment. I use XOpenDisplay() function to open other display. It work well if someone use the display already. But when I test to open the display nobody use, I found that it does not return NULL for showing fail and it stop to work. What should I do to know the display is used or not ? It seems that if the display is not used, it take to long time or there is a problem on XOpenDisplay() function. I want to know the truth and good alternative.
mouse@LARRY.MCRCIM.MCGILL.EDU (12/07/90)
> I have programmed multi-user talk program. I use motif and X window > system for my environment. I use XOpenDisplay() function to open > other display. It work well if someone use the display already. But > when I test to open the display nobody use, I found that it does not > return NULL for showing fail and it stop to work. Normally, if no server is running, it will return 0 right away. If the machine is unreachable, it will time out and return 0. If neither of these is happening, I would guess that your displays are under the control of xdm. When xdm has its login window up, I believe the server is normally grabbed. When a client tries to connect, the connection will typically succeed immediately (because the server's connection-accepting socket is still listening for connections) but the server will pay no attention to the new connection until someone logs in and the server is ungrabbed. I don't see any real solution to your problem as stated. Everything in the above description is functioning the way it's intended to. About all I can say is to ask why you're trying to XOpenDisplay on a display without even knowing whether anyone's on it or not.... der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu