Re: GIOChannel


   Thanks .. I have taken a look at the Gnet Lib. I will use it instead of
reinventing the wheel.

   Thanks again.


--- Tim Müller <zen18864 zen co uk> wrote:
On Monday 19 January 2004 22:22, Harring Figueiredo wrote:

 Folks, I am creating a GIOChannel, and I get the error:
[Invalid UTF-8] üôÿ¿

 How can I set up so that it does not fail. (Thanks -- se code below)
NOTE: I don't even have a chance to write to it.


    /* create the channel */
    server = g_io_channel_unix_new(socketfd);
    if(server == NULL){
            g_print("Count not create server..");
            return FALSE;

     g_io_channel_set_encoding (c, NULL, NULL); 
     g_io_channel_set_buffered (c, FALSE); 

silly question maybe, but why 'c' and not

      g_io_channel_set_encoding (server, NULL, NULL); 
      g_io_channel_set_buffered (server, FALSE); 

the _set_encoding(server,NULL,NULL) is what should do the trick. It should 
also be called right after you created the GIOChannel (more or less).

Btw, in case you haven't yet, you might also want to have a look at the GNet 
library's GServer and GConn interfaces, which might just do exactly what you 
want without all the GIOChannel hassle:

A similar library is the fairly new libgnetwork, which seems to require 
glib-2.3.x or newer though:


gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes

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