Re: [gtkmm] On Glib::IOChannel wrappers
- From: MHL Schulze t-online de (Martin Schulze)
- To: Tassos Bassoukos <abas aix meng auth gr>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: [gtkmm] On Glib::IOChannel wrappers
- Date: Fri, 13 Sep 2002 21:22:15 +0200
Am 12.09.2002 23:27 schrieb(en) Tassos Bassoukos:
Hi all,
lately i've felt the need to wrap libgnet, a socket library intended for
use by Gtk+ programs. The major problem I've stumbled upon is that gnet
is
returning GIOChannel's (not int's), which are not wrapped in glibmm.
I've now written some preliminary wrappers, but they need some polishing
first; most importantly, I need enlightenment on some items so that they
will fit well with the rest of Glib:
* IOChannels have the potential for lots of errors, as evidenced by the
ever-present GError**. Should these be thrown as C++ exceptions by the
wrappers, or should I use a trailing Glib::Error*& parameter?
* Glib::Source (as currently implemented) cannot wrap non-glibmm
generated GSource's, ergo Glib::IOChannel cannot generte watches,
I agree with Murray: A patch adding Glib::Source::Source(GSource* source)
would be welcome (but probably non-trivial)! :-)
removing
one of IOCHannels more useful features. One could use
SignalIO.connect(int
fd,IOCondition cond), but that is non-portable as Win32 sockets are not
represented as ints, and are not regular file descriptors. Also, it looks
ugly :-)
1. Just to make clear: You are talking about sockets and not about pipes
or something similar that is represented by an int ("HANDLE") in Win32 ?!
I do hope that the latter is supported by Glib::IOSource. Since there was
no feedback so far regarding that matter and I'm not using Win32 I don't
really know, however! Does GIOChannel support Win32 sockets anyway and how?
2. What do you mean by "ugly"? Can you think of a more elegant API?
3. Talking about portability: In the very first lines of your patch I
notice a call to g_io_channel_unix_new(). Are you sure this is a
portable function? I remember that I avoided it in the implementation
of Glib::IOSource. Also are you sure that g_io_channel_new_file() is
portable?
4. I don't want to be ignorant, but why do you need GIOChannel at all?
What functionality does it provide that ANSI C++ streaming classes don't?
Support for Win32 sockets??
Regards,
Martin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]