This is the mail archive of the
guile-gtk@sourceware.cygnus.com
mailing list for the Guile project.
Re: select+read on socket in guile,guile-gtk
- To: Guile-GTK List <guile-gtk at sourceware dot cygnus dot com>
- Subject: Re: select+read on socket in guile,guile-gtk
- From: Steve Tell <tell at telltronics dot org>
- Date: Wed, 21 Jun 2000 00:25:36 -0400 (EDT)
Its probably bad form to follow up my own question, but I realized that
there might be another way to do what I'm trying to do...
if guile's cooperative threads play nice with guile-gtk -
Can I create and maniuplate Gtk+ GUIs from any thread?
thanks again,
Steve
On Mon, 19 Jun 2000, Steve Tell wrote:
>
> Does guile-gtk provide a way to hook (file descriptors from) guile ports
> into the Gtk+ select loop? Glib's GIOChannel's perhaps?
> I know I could fall back on gtk-idle-add, but it seems less clean.
>
> Next question then is, how do I do a non-blocking read on a guile port,
> returning as many characters as are available right now? Is there an
> interface to the raw read(2) system call, like perl's sysread()?
>
> What I'm ultimately trying to do is arrange for a procedure to get called
> with complete lines read from a connected TCP socket, so that information
> recieved from the server at the other end can be used to update a
> items in a guile-gtk interface.
>
> In C its easy:
> fd = socket()
> conect(fd ... )
> /* use my select, or hook into fd_set of another select() caller */
>
> n = read(fd, rbuf, sizeof(rbuf))
> /* scan buffer, looking for newlines. When a whole line is
> found, dispatch to line-parsing function. Save partial
> lines for next time around */
>
> I've already built a version of this in C hooked to guile for an app that
> already has extensive C routines linked in, but I'd rather do a little
> desk-widget companion in pure guile-gtk if possible.
> Guile already has all of the the socket operations, so I suspect
> I'm just overlooking somthing.
>
>
> thanks,
> Steve
> steve@telltronics.org
>
>
>
>
>
>