Re: g_io_channel and UDP sockets
- From: Jeff Abrahamson <jeff purple com>
- To: gtk-list gnome org
- Subject: Re: g_io_channel and UDP sockets
- Date: Tue, 24 Feb 2004 14:20:22 -0500
On Tue, Feb 24, 2004 at 08:07:11PM +0100, Sven Neumann wrote:
> > 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.
Thanks, I had misread that part. That fixes the error messages.
> > 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.
It's not so bad, I was just hoping to limit a bit more how much of my
code knew this was a UDP socket. As soon as I grab the fd and call
recvfrom, I'm using that knowledge.
Jeff Abrahamson <http://www.purple.com/jeff/>
GPG fingerprint: 1A1A BA95 D082 A558 A276 63C6 16BF 8C4C 0D1D AE4B
] [Thread Prev