[comp.windows.x] sockets and X events

jlunny@TWG.COM (John Lunny) (09/22/89)

hi,

i'm one of those "you've been using X so you must be an expert, please
write this application" type of person.  in other words, i'm a beginner
in terms of writing X applications and i have a couple of questions.

i use the select() system call with a timeout of usually five seconds in
the hopes of receiving a response from a machine.  i've found however, 
that X is blocked out of the whole picture when i try to do this, so 
sometimes it can take up to five seconds for an X event to get serviced.
so then i called this great little macro XConnectionNumber() to get the
X file descriptor in order for select() to return in case an X event
occurs.  so my first question is if there is a more accepted way of doing
this kind of thing.  but to continue, then i thought i would be smart and
i saved the XConnectionNumber() in a variable and use that variable for 
the netmask used in the select() call.  with this scheme, things would
work quite well for awhile, and then it appeared as though this use of
select() didn't work and no X events would get serviced.  its as though
the X file descriptor had changed.... so that's my second question.

thanks in advance, i appreciate your help.

john lunny