Interrupted system call issues
Keith Davidson
kbd@i...
Thu, 06 Jul 2000 12:42:33 -0000
In order to get Medusa to play nicely in an application that uses
SIGALRM, I had to make some changes to asyncore.py. Basically the
change causes EINTR to be ignored if it is raised during the select
(). According to "UNIX Network Programming" pg 124, it is ok to
restart accept(), read(), write(), select(), etc after an EINTR. My
questions...
1) Is simply ignoring the exception the right way to 'restart' the
select() call?
2) Any other options for making Medusa work in an app with SIGALRM
(no... I can't get rid of the SIGALRMs ;-).
3) Any possibility of incorporating this into the official version of
Medusa if all the networking gurus agree it is correct?
Thanks!
Keith
35d34
< EINTR = 10004
43c42
< from errno import EALREADY, EINPROGRESS, EWOULDBLOCK,
ECONNRESET, ENOTCONN, ESHUTDOWN, EINTR
---
> from errno import EALREADY, EINPROGRESS, EWOULDBLOCK,
ECONNRESET, ENOTCONN, ESHUTDOWN
56,61c55
< while 1:
< try:
< (r,w,e) = select.select (r,w,e,
timeout)
< break
< except select.error, (errno, errstr):
< if errno != EINTR: raise
---
> (r,w,e) = select.select (r,w,e, timeout)