SIGALRM question



I am a GTK newbie, and am trying to play around with some simple GUI
front ends for some applications.  I am using GTK+ v1.0.1 and am
doing testing both on Linux and Solaris (2.5.1).  I have looked through
recent postings to this list and saw some relevant info, but still
didn't get the answer to my question.

I have an application that uses sockets to communicate with a server
process.  If the connection goes down, I want to update the contents
of a gtk_label widget and set an alarm() to go off in a second or
so to try to reconnect.  What happens is the gtk_label widget is
not updated on the screen until after the alarm() has occured.
I am using alarm(5) at the moment to better see what is happening.
It appears that gtk_main() stops running until after the alarm has
expired.  In the alarm routine, I check for a connection again and
if it is still down, reset the alarm.  After the first interval, everything
seems OK.  i.e. subsequent calls to alarm(5) from the alarmhandler do
not cause this problem.  Additionally, this is only happening on the
Solaris machine.  The Linux box works fine. I have installed the alarmhandler
using sigaction(), and if there was a handler already in place when sigaction
is called, then I call that routine from the alarmhandler.

Anyone have any ideas, or comments?  I am open to using something other than
alarm() if there is a good reason, however I have some non GTK apps that I
would like to use the same code snippets on so I would prefer not to rely on
GTK for that functionality.

thanks,
bob

-----------
This message was sent by XFMail at 16:36:43 on 13-May-98 by:
Bob Robison          Southwest Research Institute,http://www.swri.org
Principal Engineer         Signal Exploitation & Geolocation Division
brobison@swri.org               Phone:(210)522-3935/Fax:(210)522-2709
<><    <><    <><    <><    <><    <><    <><    <><    <><   Col 3:2



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