Path: utzoo!attcan!uunet!mcsun!ukc!stl!skp From: skp@stl.stc.co.uk (Steve Perryman ) Newsgroups: comp.std.c Subject: sockets and signals (in C) Keywords: sockets signals Message-ID: <3292@stl.stc.co.uk> Date: 8 Aug 90 13:55:23 GMT Sender: news@stl.stc.co.uk Reply-To: "Steve Perryman " Organization: STC Technology Limited, London Road, Harlow, Essex, UK Lines: 33 Does anyone know of a way to set up a signal handler such that if a flood of data comes in to a socket, the SIGIO/SIGPOLL (maybe even SIGURG) signal can invoke a handler fast enough such that a variable can be incremented to represent the correct number of data items at the socket. The signal handler will be : void catch() { signal(SIGIO,catch) ; count++ ; ... ... } I've used fcntl to allow the socket to interrupt : fcntl(sock,F_SETOWN,getpid()) ; fcntl(sock,F_SETFL,F_ASYNC) ; ... ... This works but it can't log the correct number of items received if they come in as bursts of data (5+ items per burst). Can this timing problem be resolved using SIGIO , or is another way required ??? Thanks in advance, Steven Perryman (skp@stl.stc.co.uk)