public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
From: Steve Tell <tell@telltronics.org>
To: Guile-GTK List <guile-gtk@sourceware.cygnus.com>
Subject: Re: select+read on socket in guile,guile-gtk
Date: Tue, 20 Jun 2000 21:25:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.21.0006210022070.30497-100000@ariel.lan.telltronics.org> (raw)
In-Reply-To: <Pine.LNX.4.21.0006192256190.29363-100000@ariel.lan.telltronics.org>

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
> 
> 
> 
> 
> 
> 

  reply	other threads:[~2000-06-20 21:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-19 20:17 select+read on socket in gtk,guile-gtk Steve Tell
2000-06-20 21:25 ` Steve Tell [this message]
2000-06-21 21:50   ` select+read on socket in guile,guile-gtk Steve Tell
2000-06-22  2:19     ` Mikael Djurfeldt
2000-06-21 15:27 ` select+read on socket in gtk,guile-gtk Gary Houston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.21.0006210022070.30497-100000@ariel.lan.telltronics.org \
    --to=tell@telltronics.org \
    --cc=guile-gtk@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).