🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1559

Re: sockets and signals (in C)

#1559
From: diamond
Date: Fri, 10 Aug 1990 02:20
24 lines
1895 bytes
In article <3292@stl.stc.co.uk> "Steve Perryman " <skp@stl.stc.co.uk> writes:

>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.

ANSI C does not provide any way of obtaining information about sockets, or
even to create a socket in the first place.  I have redirected follow-ups
to comp.lang.c because I don't follow the system-specific groups well enough
to know where to put it.  (Sorry.)

One characteristic of signals is that while you are handling a signal, if
more of the same signal arrive, they probably will not even be delivered,
or perhaps one will be delivered.  Nothing prohibits an implementation from
delivering all of them, but most do not do so.

If you want to know how many items are waiting at a socket, you have to
see if there is a socket-related system call to determine this.  Select
can be used to distinguish between zero and non-zero (and I've never had
to know the exact quantity).
-- 
Norman Diamond, Nihon DEC     diamond@tkou02.enet.dec.com
This is me speaking.  If you want to hear the company speak, you need DECtalk.
Technical Details
Message-ID: <1911@tkou02.enet.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!decvax.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!diamond
References: <3292@stl.stc.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!decvax.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!diamond
From: diamond@tkou02.enet.dec.com (diamond@tkovoa)
Newsgroups: comp.std.c,comp.lang.c
Subject: Re: sockets and signals (in C)
Keywords: sockets signals
Message-ID: <1911@tkou02.enet.dec.com>
Date: 10 Aug 90 02:20:46 GMT
References: <3292@stl.stc.co.uk>
Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa)
Followup-To: comp.lang.c
Organization: Digital Equipment Corporation Japan , Tokyo
Lines: 24