Re: IO fails
- From: Tristan Van Berkom <vantr touchtunes com>
- To: Sipilä Matti <matti sipila iki fi>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: IO fails
- Date: Thu, 22 May 2003 10:21:18 -0400
Sipilä Matti wrote:
I've noticed that the reason is "input watcher", which in both cases does
something that causes close to fail. Why??? I also noticed strange thing,
that when using close (fd+1), system seems to work (re-open comport). So,
does anyone know what might be the reason?
I've seen that once when screwing aroung with a java native library
(in order to get some non-blocking input), In that case, file descriptors
were offset by 1 (i.e. the first available fd == 1 and not 0). But when
open give's
you a file descriptor and close crashes on it, you have a really wierd
problem.
(I guess you can trust a windows system to scew with your brain like
that ;-)
Also it would be nice to know
the meaning of reference counting (found in manuals ie.
http://developer.gnome.org/doc/API/2.0/glib/glib-io-channels.html#g-io-channel-unix-new)
Refcounts count the references to any given object,
in this case, (since the GIOChannel object comes with a reference count
of 1), you dont have to worry about the object dissapearing untill you
release your reference to it (i.e. g_object_unref). Often, Objects are
"owned" by other objects (such as gtk container implementations) and you
only need a reference to the container, when you attempt to "unref" your
container, the container will in turn "unref" everything it contains, which
will result in those objects being destroyed unless you've explicitly
referenced them yourself.
HTH,
-Tristan
- References:
- IO fails
- From: =?ISO-8859-1?Q?Sipil=E4_Matti?=
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]