Re: g_io_add_watch, g_io_channel_read stops working after sometime.
- From: Tim Müller <t i m zen co uk>
- To: Rehan <rehan shaikh radarspot com>
- Cc: gtk-devel-list gnome org
- Subject: Re: g_io_add_watch, g_io_channel_read stops working after sometime.
- Date: Thu, 19 Apr 2007 09:33:37 +0100
On Wed, 2007-04-18 at 04:30 -0700, Rehan wrote:
The gtk-devel mailing list is mostly for development of GLib/Gtk+
itself, questions about using those libraries should be taken to
gtk-list or gtk-app-devel list.
> I am confused as the code works for 4-5 request and then simply starts
> ignoring the client messages. Is g_io_add_watch ignoring the incoming
> in summary function calls:
> ->bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)))
> ->accept(sockfd, (struct sockaddr *) &cli_addr, &clilen)
> ->g_io_channel_unix_new (global_sock)
> ->g_io_add_watch(listenonsocket, G_IO_IN | G_IO_PRI,read_request,
- does your read_request() callback return TRUE whenever called? (or
rather: make sure it returns something in the first place)
- you should probably also watch for G_IO_HUP and G_IO_ERROR
- there are a bunch of libraries that provide higher-level abstractions
for this stuff based on GLib, such as GNet or libgnetwork (just FYI,
there's nothing wrong in principle with doing things directly).
] [Thread Prev