Re: g_io_channel and UDP sockets



Hi,

Jeff Abrahamson <jeff purple com> writes:

> Setting the encoding unfortunately just gives me a different error
> stream.  Now I see an infinite stream of these:
> 
>     (process:12739): GLib-CRITICAL **: file giochannel.c: line 1662 (g_io_channel_read_to_end): assertion `(error == NULL) || (*error == NULL)' failed
> 
> I get this by calling
> 
>     GError *err;
>     iostat = g_io_channel_read_to_end(source,  &str_return, &length, &err);

Read the docs on GError, you need to initialize the err variable to NULL.

> I note that in blib you do the same work-around I had settled on:
> 
>     req_fd = g_io_channel_unix_get_fd (io);
>     buf_read = recvfrom (req_fd, buf, sizeof (buf), 0,
>                         (struct sockaddr *) &req_addr, &req_addr_length);

I don't see this as a workaround.


Sven



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]