2009/12/22 Krzesimir Nowak <[email protected]>: > On Tue, 2009-12-22 at 10:58 +0100, Glus Xof wrote: >> Hello guys, >> >> How can I "construct" this channel "a la Glibmm & Giomm" ?... >> >> Which method is the equivalent of socket() (if any) ? >> Which method is the equivalent of bind() (if any) ? >> Which method is the equivalent of listen ().... and accept()... and >> connect()... >> >> Thanks to all, >> >> Glus > > Hi, > > you probably misunderstood IOChannels. You have to create a socket > first, then bind/accept/whatever and then create IOChannel with > create_from_fd static method (or else). GIOChannels were created > probably for portable I/O operations like reading from and writing to, > since these are most often use cases of files/sockets/pipes. But > creating them was meant to be written in some sort of backend code like > this: > > Glib::RefPtr<Glib::IOChannel> get_channel() > { > #ifdef WINDOWS > // create a socket in windows and obtain its descriptor > int s_fd = something(); > Glib::RefPtr<Glib::IOChannel> my_channel = > Glib::IOChannel::create_from_win32_socket(s_fd); > #else > int s_fd = socket(...); > Glib::RefPtr<Glib::IOChannel> my_channel = > Glib::IOChannel::create_from_fd(s_fd); > #endif > return my_channel; > }
Thanks, Krzesimir, I think that now it's a little more clear... > For sockets - use GSocket. But C++ wrapper of GSocket just hit the > unstable version of Giomm, so you'll probably have to use C API. I just looked up GSocket & seems interesting... the stable GIOmm will be released soon ? Glus > Krzesimir > > _______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
