From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 24B01BB83 for ; Sat, 15 Apr 2006 22:58:28 +0200 (CEST) Received: from chokecherry.srv.cs.cmu.edu (CHOKECHERRY.SRV.CS.CMU.EDU [128.2.185.41]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k3FKwQJC016133 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=FAIL) for ; Sat, 15 Apr 2006 22:58:27 +0200 Received: from stratocaster.home (lLwN7RkW@c-24-3-154-200.hsd1.pa.comcast.net [24.3.154.200]) (authenticated bits=0) by chokecherry.srv.cs.cmu.edu (8.13.5/8.13.5) with ESMTP id k3FKwOtV023303 (version=TLSv1/SSLv3 cipher=DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 15 Apr 2006 16:58:26 -0400 (EDT) Received: from ecc by stratocaster.home with local (Exim 4.60) (envelope-from ) id 1FUrqa-0004C8-L4 for caml-list@yquem.inria.fr; Sat, 15 Apr 2006 16:58:24 -0400 Date: Sat, 15 Apr 2006 16:58:24 -0400 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] lablgtk2: receiving messages from network? Message-ID: <20060415205824.GA16109@localhost> Mail-Followup-To: caml-list@yquem.inria.fr References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11+cvs20060126 From: Eric Cooper X-Miltered: at concorde with ID 44415E72.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lablgtk:01 gtk:01 gtk:01 15,:98 2006:98 wrote:01 caml-list:01 marshal:01 data:02 data:02 callback:02 blocking:04 interface:05 channel:05 implement:06 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On Sat, Apr 15, 2006 at 03:33:36PM -0400, Ivan Matveich wrote: > I'm writing a gtk program that must receive data through a tcp > connection and react to it immediately. > > What's the best way to implement this? > Can gtk call me back when data is available on a socket? > How do I use Marshal without blocking? You can use the Glib.IO interface to create a glib io_channel from your TCP socket, and then use add_watch to associate a callback with it. Your socket will then be polled as part of the Glib main event loop. -- Eric Cooper e c c @ c m u . e d u