Re: g_io_add_watch, g_io_channel_read stops working after sometime.
- From: Rehan <rehan shaikh radarspot com>
- To: gtk-app-devel-list gnome org
- Subject: Re: g_io_add_watch, g_io_channel_read stops working after sometime.
- Date: Thu, 19 Apr 2007 06:18:32 -0700 (PDT)
The problems seems to be solved.. I had to return TRUE from my callback
function read_request() and listentosocket is the channel. "listentosocket =
thanks for your reply and yes i am now listening to G_IO_HUP also...
James Scott Jr-2 wrote:
On Wed, 2007-04-18 at 04:39 -0700, Rehan wrote:
I am trying to write a program based on client-server architecture. I
only one client connection hence i am first listening to client then
accept() is called. after accept() i call g_io_channel_unix_new () and
g_io_add_watch() and later in the function i use g_io_channel_read to
data from the channel.
Everything works fine till 4-5 requests from the client. Later the
simply stops listening to client. I have tried tcpdump on server side and
do recieve the TCP packet from the client. So it means there is some bug
server side. I am not sure if i have done something wrong or some bug in
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
signals?? thats what i can detect from my gdb tracing.... there is no
invocation of my function even if i recieve a packet on server side from
in summary function calls:
->bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)))
->accept(sockfd, (struct sockaddr *) &cli_addr, &clilen)
->g_io_add_watch(listenonsocket, G_IO_IN |
What is "listenonsocket" ? Why no "G_IO_HUP" ? the above sequence is
correct; however the api values seem to be wrong and in the wrong order!
Post or include the real code.
As an example, look at the code in this sample "sknet" for the following
I hope somebody comes to my rescue its been now 3 days i am trying to
this problem but no success...
Thanks in advance for all great coders....
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
View this message in context:
Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com.
] [Thread Prev