On Tue, 2007-05-29 at 22:42 +0100, Robert Pearce wrote:
> My understanding was that the Glib idle task checks the IO channel
> status and calls the callback if it's ready. Since Glib is non-threaded,
> this cannot happen during a previous execution of the callback. And
> since it uses the chann
On Tue, 2007-05-29 at 22:42 +0100, Robert Pearce wrote:
> On Tue, 29 May 2007, Jonathan Winterflood
> <[EMAIL PROTECTED]> wrote :
> >
> >A question arises, though: is it possible that the channel will recieve
> >the last of the data between the
> >time g_io_channel_read_chars returns G_IO_STAT
Looking at the glib source here:
glib/giochannel.c
glib/giochannel.h
glib/giounix.c
You can see that, at least on a *nix machine, g_io_channel_read_chars()
calls the c library read() on a file descriptor in the GIOChannel
struct. The segment:
On Tue, 29 May 2007, Jonathan Winterflood
<[EMAIL PROTECTED]> wrote :
>
>A question arises, though: is it possible that the channel will recieve
>the last of the data between the
>time g_io_channel_read_chars returns G_IO_STATUS_AGAIN and the callbac
>k exits, and that the callback will not be
Thanks for your precisions on where this difference comes from :)
I guess g_io_channel_set_flags(_channel, G_IO_FLAG_NONBLOCK, NULL); is
good for switching to non-blocking mode.
A question arises, though: is it possible that the channel will recieve the
last of the data between the
time g_io
Callbacks on a GIOChannel (as described) are re-entrant!. I know since i
have hit this problem. Essentially you must read what you can. If its a
socket you would have soimething like
bytes_read = recv( fd, ( void * ) ( &buffer[
current_byte ] ), expected_size );
On Mon, 2007-05-28 at 17:26 +0200, Jonathan Winterflood wrote:
> Hi,
>
> > you never know how much readable data is available until you read
> it, you are only ever guaranteed to have one byte of data available
> for reading anyway.
>
> In my opinion, the channel should _always_ know how much dat
Hi,
you never know how much readable data is available until you read it, you
are only ever guaranteed to have one byte of data available for reading
anyway.
In my opinion, the channel should _always_ know how much data is available,
how can it tell that there is nothing there?... Plus, it can
On 5/28/07, Ana <[EMAIL PROTECTED]> wrote:
> On Mon, May 28, 2007 at 04:42:11PM -0300, Alexandre Moreira wrote:
> > On 5/28/07, Robert Pearce <[EMAIL PROTECTED]> wrote:
> > > On Sun, 27 May 2007 16:57:03 +0200 Jonathan wrote:
> > > > Hi,
> > > >
> > > > I need to read a large amount of data from a
On Mon, May 28, 2007 at 04:42:11PM -0300, Alexandre Moreira wrote:
> On 5/28/07, Robert Pearce <[EMAIL PROTECTED]> wrote:
> > On Sun, 27 May 2007 16:57:03 +0200 Jonathan wrote:
> > > Hi,
> > >
> > > I need to read a large amount of data from a GIOChannel (200K, over
> > > the internet).
> > >
> > >
On 5/28/07, Robert Pearce <[EMAIL PROTECTED]> wrote:
> On Sun, 27 May 2007 16:57:03 +0200 Jonathan wrote:
> > Hi,
> >
> > I need to read a large amount of data from a GIOChannel (200K, over
> > the internet).
> >
> > So far, I use the gnet library to create the
> > socket, and then I use the GIOCha
On Sun, 27 May 2007 16:57:03 +0200 Jonathan wrote:
> Hi,
>
> I need to read a large amount of data from a GIOChannel (200K, over
> the internet).
>
> So far, I use the gnet library to create the
> socket, and then I use the GIOChannel to integrate the read/writing
> into the program's loop (a
> G
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Tristan Van Berkom wrote:
> On Sun, 2007-05-27 at 16:57 +0200, Jonathan Winterflood wrote:
>> Hi,
>>
>> I need to read a large amount of data from a GIOChannel (200K, over the
>> internet).
>>
>> So far, I use the gnet library to create the
>> socket,
On Sun, 2007-05-27 at 16:57 +0200, Jonathan Winterflood wrote:
> Hi,
>
> I need to read a large amount of data from a GIOChannel (200K, over the
> internet).
>
> So far, I use the gnet library to create the
> socket, and then I use the GIOChannel to integrate the read/writing into the
> program
Hi,
I need to read a large amount of data from a GIOChannel (200K, over
the internet).
So far, I use the gnet library to create the
socket, and then I use the GIOChannel to integrate the read/writing
into the program's loop (a
GTK application)
I use g_io_add_watch(_channel, G_IO_IN, &(_imageDat
15 matches
Mail list logo