home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!mips!sdd.hp.com!ux1.cso.uiuc.edu!usenet.ucs.indiana.edu!daimler.ucs.indiana.edu!jackson
- From: jackson@daimler.ucs.indiana.edu (Jeff Jackson)
- Newsgroups: comp.unix.programmer
- Subject: SIGPIPE Delivery on socket close
- Keywords: SIGPIPE signal TCP socket
- Message-ID: <BtCqCG.DMw@usenet.ucs.indiana.edu>
- Date: 21 Aug 92 21:00:15 GMT
- References: <1992Aug19.001455.222056@zeus.calpoly.edu>
- Sender: news@usenet.ucs.indiana.edu (USENET News System)
- Organization: University Computing Services
- Lines: 26
- Nntp-Posting-Host: daimler.ucs.indiana.edu
-
- Greetings,
-
- I'm developing a server which needs to time out connections that are
- inactive for some specified time. When the server detects that the
- timeout period has elapsed, it closes the socket.
-
- In the client, after the server has timed out and closed the socket,
- I expected to get a SIGPIPE signal the next time I tried a write to
- the socket. What I am finding is that the first write that I do to
- the socket completes normally - returning the number of bytes that
- were written. Sometimes even the second write will appear to succeed.
- Usually however the second or third write causes the SIGPIPE signal, which
- is trapped and closes the socket.
-
- What needs to be done to get the SIGPIPE signal the FIRST time I write
- to the socket?
-
- Thanks for any clues,
-
- JLJ
-
- --
- +---------------------------------------------------------------------------+
- | Jeff Jackson (812) 855-8002 jackson@daimler.ucs.indiana.edu |
- | Indiana University Program for Distributed Computing Unix Development |
- +---------------------------------------------------------------------------+
-