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

Frontend for a distributed IP multicast program




Matthew Hiller writes:
  >	The solution that I came up with was to set up a signal-handling
  >function that reads pending messages off the socket and call alarm(1)
  >before entering gtk_main(). (I'd also put another alarm(1) at the end of
  >the signal handling function; the net effect being that the program would
  >thus check the socket once per second.)


Have a look at gdk_input_add() routine.  You can have the Gtk event
loop monitor events on the socket by supplying this rouinte the scoket
descriptor and attach a callback function which will be called
whenever socket is ready to be read.

This way, your application will become asynchronous (instead of
polling the socket).  Does this help?

Regards,
sanjay



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