• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SIGPIPE?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGPIPE?


  • Subject: Re: SIGPIPE?
  • From: Malte Tancred <email@hidden>
  • Date: Wed, 8 May 2002 10:46:20 +0200

On wednesday, may 8, 2002, at 05:05 , Andrew Baldwin wrote:
Now that my code for connecting to the network and forwarding packets is complete I get a SIGPIPE error after connecting to several clients and sending/receiving messages...

My basic question, what is a SIGPIPE error -- would it be caused by a problem with the network connections or the thread connections (the only info I found on SIGPIPE was that it involved one side of a socket connection dropping out, does this mean that the connection between threads is dropping or that the network connection on one side is dropping [I doubt the latter since I check vigorously for dropped connections]).

You must handle SIGPIPE errors as they can occurr whenever you try to write to a socket, even if you "check vigorously for dropped connections".

The connection might be dropped during the write even if you beforehand make sure that the socket is writable.

From the man page for the write system call:
...
[EPIPE] An attempt is made to write to a pipe that is not open
for reading by any process.

[EPIPE] An attempt is made to write to a socket of type that
is not connected to a peer socket.
...

Try this:

signal(SIGPIPE, SIG_IGN);

This tells the program to ignore the raised SIGPIPE signal. Check the man page for the signal system call for a description.

Hope this helps.

Cheerio,
Malte
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >SIGPIPE? (From: Andrew Baldwin <email@hidden>)

  • Prev by Date: distributed objects: runloop not serialized?
  • Next by Date: Completely off-topic! Network time server 1 hour behind ?
  • Previous by thread: SIGPIPE?
  • Next by thread: Authentication
  • Index(es):
    • Date
    • Thread