In addition to the connection to the X server, an Xlib implementation may require connections to other kinds of servers (for example, to input method servers as described in "Locales and Internationalized Text Functions"). Toolkits and clients that use multiple displays, or that use displays in combination with other inputs, need to obtain these additional connections to correctly block until input is available and need to process that input when it is available. Simple clients that use a single display and block for input in an Xlib event function do not need to use these facilities.
To track internal connections for a display, use XAddConnectionWatch().
To stop tracking internal connections for a display, use XRemoveConnectionWatch().
To process input on an internal connection, use XProcessInternalConnection().
To obtain all of the current internal connections for a display, use XInternalConnectionNumbers().