xlib internal connections - Xwindows

This is a discussion on xlib internal connections - Xwindows ; I tried... - xaddconnectionwatch. the callback function never gets called. - xinternalconnectionnumber. it returned 0 as number of connections. - xconnectionnumber. selecting on them blocks forever. Any ideas what might be going wrong?...

+ Reply to Thread
Results 1 to 3 of 3

Thread: xlib internal connections

  1. xlib internal connections


    I tried...

    - xaddconnectionwatch. the callback function never gets called.
    - xinternalconnectionnumber. it returned 0 as number of connections.
    - xconnectionnumber. selecting on them blocks forever.

    Any ideas what might be going wrong?

  2. Re: xlib internal connections

    Carl Eike Hofmeister wrote:
    >
    >I tried...
    >
    >- xaddconnectionwatch. the callback function never gets called.
    >- xinternalconnectionnumber. it returned 0 as number of connections.
    >- xconnectionnumber. selecting on them blocks forever.
    >
    >Any ideas what might be going wrong?


    You really should say what you are trying to do ...

    As an Xlib user, you open a connection to a display with XOpenDisplay.
    You can get the fd associated with that connection using
    XConnectionNumber(dpy), and that is what you set in the select mask.

    There are a few situations in which Xlib may open a connection itself;
    one example would be the input method for an Asian language. (It needs
    a separate connection because grabs are done on a per-connection basis.)
    It is these internal connections that are reported by XAddConnectionWatch
    and XInternalConnectionNumber -- you likely have none.

    So, I would suggest that you re-read the select manpage to ensure that
    you are indeed using select properly.


  3. Re: xlib internal connections

    Kip Rugger wrote:

    > As an Xlib user, you open a connection to a display with XOpenDisplay.
    > You can get the fd associated with that connection using
    > XConnectionNumber(dpy), and that is what you set in the select mask.
    >
    > There are a few situations in which Xlib may open a connection itself;
    > one example would be the input method for an Asian language. (It needs
    > a separate connection because grabs are done on a per-connection basis.)
    > It is these internal connections that are reported by XAddConnectionWatch
    > and XInternalConnectionNumber -- you likely have none.
    >
    > So, I would suggest that you re-read the select manpage to ensure that
    > you are indeed using select properly.


    I was assuming the connection to the server was also included in the
    set of internal connections.
    And indeed the calculation of the fdset from all 3 ways of getting
    descriptors from xlib contained a bug.

    Thanks.

+ Reply to Thread