Re: Data available for reading in a GIOChannel



Callbacks on a GIOChannel (as described) are re-entrant!.  I know since i have hit this problem.  Essentially you must read what you can.  If its a socket you would have soimething like

                           bytes_read = recv( fd, ( void * ) ( &buffer[ current_byte ] ), expected_size );
                           current_byte += bytes_received;

and then you would exit the function.  If current_byte hasn't reached the expected_size, then you just gotta wait till you
get called back again.  But under no circunstance should you loop in this function.  You will not get what you want if you do that.

travis miller
raphtee gmail com




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