signal SIGUSR1 should send a byte via socket

Richard Mertens richard.mertens at wolfi.org
Tue Jun 10 05:04:22 EDT 2003


this a part of my sourcecode
It is a normal tcp-client which receive bytes from a server.
After i send the program the signal sigusr1 it should send /17 to the host
but this doesn't work as i expected.

I always get the follow error message

  File "/appl/komm/komm.py", line 82, in ?
    ungefiltetertext = s.recv(1)
socket.error: (4, 'Interrupted system call')

how could i solve this?


global s


def handler(signum, frame):
	s.send("/17")
	mysqllog(cursor,nr,"SIGUSR1")

signal.signal(signal.SIGUSR1,handler)

    	s = socket(AF_INET,SOCK_STREAM)		
    	try:
	    	s.connect((verb_x.host,verb_x.port))
		mysqllog(cursor,nr,gethostname()+" OK")
    	    	while (1):
				ungefiltetertext = s.recv(1)




More information about the Python-list mailing list