From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Reading D-Bus messages Date: Wed, 12 Aug 2009 20:47:56 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1250077853 7974 80.91.229.12 (12 Aug 2009 11:50:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Aug 2009 11:50:53 +0000 (UTC) Cc: Mario Lang , "emacs-devel@gnu.org" To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 12 13:50:46 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MbCLr-0005YF-Vp for ged-emacs-devel@m.gmane.org; Wed, 12 Aug 2009 13:50:44 +0200 Original-Received: from localhost ([127.0.0.1]:36815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbCLp-00080I-EH for ged-emacs-devel@m.gmane.org; Wed, 12 Aug 2009 07:50:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbCJJ-0007EY-Cd for emacs-devel@gnu.org; Wed, 12 Aug 2009 07:48:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbCJC-0007Bn-UY for emacs-devel@gnu.org; Wed, 12 Aug 2009 07:48:03 -0400 Original-Received: from [199.232.76.173] (port=38447 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbCJC-0007Bh-PU for emacs-devel@gnu.org; Wed, 12 Aug 2009 07:47:58 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:64209) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MbCJC-0004Ix-61 for emacs-devel@gnu.org; Wed, 12 Aug 2009 07:47:58 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 0E3552C40; Wed, 12 Aug 2009 20:47:56 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by monty-python.gnu.org: NetBSD 3.0 (DF) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:114139 Archived-At: >>>>> On Wed, 12 Aug 2009 12:43:14 +0200, Michael Albinus said: >> Usually we monitor file/socket descriptors in such cases. D-Bus >> seems to have a mechanism DBusWatch for this purpose. > DBusWatch allows you to install handlers. IIUC, those handlers are > called only when dbus_watch_handle() has been applied. File > descriptors are not monitored in the sense, that a handler is > called, when there are incoming messages. This still means polling. I mentioned DBusWatch because the documentation of dbus_connection_get_socket/dbus_connection_get_unix_fd says "DO NOT read or write to the file descriptor, or try to select() on it; use DBusWatch for main loop integration." For your purpose, doing select() on the file/socket descriptor in wait_reading_process_output (in process.c) is most important. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp