WG: [ROOT] EINTR handled in TSocket ?

From: Mathes, Hermann-Josef (Hermann-Josef.Mathes@ik.fzk.de)
Date: Tue Jul 13 2004 - 12:02:50 MEST


 
Dear Rooters,
 
well, it seems you can forget my question. I grep'ed a bit more around...
 
SA_RESTART flag set on struct sigaction should solve the problem and I commented that definitely out in my call to sigaction() ...
And in TUnixSystem::UnixSignal() it is done !
 
Sorry for bothering everybody here.
 
Cheers
Hermann-Josef
 
 
-----Ursprüngliche Nachricht-----
Von: owner-roottalk@pcroot.cern.ch [mailto:owner-roottalk@pcroot.cern.ch] Im Auftrag von Mathes, Hermann-Josef
Gesendet: Dienstag, 13. Juli 2004 09:49
An: roottalk@cern.ch
Betreff: [ROOT] EINTR handled in TSocket ?
 
 
Dear Rooters,
 
I am in doubt that EINTR is handled properly in the TSocket class. There was a message from Fons a long time ago concerning this subject (http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk01/2317.html), but I could not find it in the code (TUnixSystem::UnixSend(), TUnixSystem::SendRaw(), TSocket::Send() and TSocket::SendRaw()).
 
I have checked it in the sources of 3.00, 3.02, 3.05/07 (the version our project uses) and the CVS HEAD version.
 
This is my code fragment and I am using the alarm() function to send periodically signals to my application:
      cout << "Sending event # " << header->GetEventNo() << endl;
 
      mess.Reset();
      mess.SetWhat( kMESS_OBJECT );
 
      mess.WriteObject( event );
 
      length = socket->Send( mess );
 
      if ( length <= 0 ) {
        cerr << "TSocket::Send() - length= " << length << endl;
        cerr << "TSystem::GetErrno()= " << gSystem->GetErrno() << endl;
      }
 
This is the printout when the SIGALARM happens during/near the socket transaction:
 
Sending event # 11941
SigAlarmHandler() was called at 1089647658 !
SigAlarmHandler() was called at 1089647659 !
TSocket::Send() - length= -1
TSystem::GetErrno()= 4
 
I am overwriting the ROOT signal handler for SIGALARM through sigaction().
 
Could you please comment on it or help me to open my eyes ... ? If it is not handled what is your suggestion ?
 
Thanks for any help, suggestions etc.
Regards
Hermann-Josef
 
**************************************************************************
*   Visit my new homepage !!! new look & feel !!! new information !!!    *
* http://www-ik.fzk.de/~mathes/Welcome.htm <http://www-ik.fzk.de/~mathes/Welcome.htm>                                *
**************************************************************************
*                                                                        *
* Dr. Hermann-Josef Mathes                                               *
* KASCADE & AUGER Collaboration                                          *
* Forschungszentrum Karlsruhe                  Phone:    +49 7247 822429 *
* Institut für Kernphysik                        FAX:    +49 7247 824075 *
* POB 3640                                                               *
* D-76021 Karlsruhe/Germany         Mail: Hermann-josef.mathes@ik.fzk.de *
*                                                                        *
**************************************************************************
 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET