Re: threaded network
- From: zucchi zedzone mmc com au (NotZed)
- To: hp redhat com (Havoc Pennington)
- Cc: agm cec uchile cl (Aldrin Martoq A.), gnome-devel-list gnome org
- Subject: Re: threaded network
- Date: Tue, 16 Nov 1999 17:10:23 +1030 (CST)
>
> The simplest solution is to read a fixed number of bytes at a time,
> then do the while(gtk_events_pending())gtk_main_iteration() trick (see
> FAQ) in between reads.
>
> Of course this breaks if the data stream is slow and you block during one
> of the reads. You could set a really short timeout on the socket or
> something to avoid this.
Wouldn't it be a lot easier/more reliable ot use a gdk_input handler
to call a callback when there actually is data ready, and to use a
non-blocking socket read? (or whatever the equivalent glib
function is these days == of gdk_input_add) - sockets are fd's too.
Michael
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]