[gnet] gnet & glib 2.0
- From: Axel Bock <news-and-lists the-me de>
- To: GNet List <gnet gnetlibrary org>
- Subject: [gnet] gnet & glib 2.0
- Date: 07 Nov 2002 14:49:13 +0100
Hi all,
I subscribed cause I'm developing a GNet app. Now I linked GNet against
GLib 2.0, and have a little problem with GLib's IOChannels, and hope
some of you can help me ... :-)
Well, the code causing the problem is the following:
*------------------------------------------------------*
while (read_bytes < packet_size) {
error = NULL;
g_io_channel_read_chars(iochannel,
buffer+read_bytes,
packet_size - read_bytes,
&temp,
&error);
if (error)
printf("[ERROR] GError: %s\n", error->message);
read_bytes += temp;
if (temp == 0)
goto _io_error;
}
*------------------------------------------------------*
If I run this, I get one of the two following errors:
GError: Invalid byte sequence in conversion input
I figured out that this is cause binary data wants to have NULL channel
encoding. So I set this, then I get (in the same code):
"(process:18169): GLib-CRITICAL **: file giochannel.c: line 1729
(g_io_channel_read_chars): assertion `(error == NULL) || (*error ==
NULL)' failed"
(yes, I set error to NULL before ... )
Well. Now I'm confused :-)
Should I switch back to GLib 1.2, or does someone know a good solution
to this problem?
Any help is much appreciated.
Thanks and greetings,
Axel.
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]