Re: [gtkmm] coming from wxWindows - need tips for good networking-libs
- From: Chris Vine <chris cvine freeserve co uk>
- To: Jonas Schrieb <mail gnome org_gtkmm schrieb de>, gtkmm-list gnome org
- Subject: Re: [gtkmm] coming from wxWindows - need tips for good networking-libs
- Date: Mon, 21 Jul 2003 00:33:11 +0100
On Sunday 20 July 2003 7:06 pm, Jonas Schrieb wrote:
> As mentioned in the topic I switched from wxWindows to gtkmm. This is
> because of several reasons that don't matter now.
> My question is, how to do networking. I've browsed a bit through the
> manual and found some IO-stuff in glib. Is it usable for simple
> TCP-client-server stuff?
> If not, what's "the gtkmm-developer's" favourite library? I've looked at
> some but a feature I miss in every library is one like wxWindow's
> "wxSocket event" which notifies me of data available for reading.
> If you don't know any libs that can do this how would you handle this
> (with gtkmm, glibmm, ... in cooperation with a networking library)?
> I'm the client and have nothing else to do than displaying the GUI.
> The server sends a package. When the package is incomming some part of
> my program gets a "message" that says "hey, you have new messages" and
> it starts reading from the socket.
In gtkmm2 look at the documentation on the function Glib::SignalIO::connect()
and the associated convenience funtion Glib::signal_io().connect(), which do
what you want so far as signalling the presence of data to be read on a
pipe/socket/filesystem with an open file descriptor. To read the data you
will need to use the standard Unix read() (if you are using a Unix-like OS),
or some other library.
] [Thread Prev