Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Broken Pipe Error.

Posted on 2003-12-07
Medium Priority
Last Modified: 2011-08-18
in my program,i am using different pthreads,and trying to connect to some servers ,recivining and sending data,i am getting Broken Pipe error, and program exiting,
some body said,it is problem of writing 2 times in a non connected socket,i am cheking the error at all writing,and if error occurs i am just closing the socket,and exiting,
but still the same problem broken pipe coming,
wat may  be the acutal problem
expecting ur helps
Question by:hirosh
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 45

Expert Comment

ID: 9894501
Hi Hirosh,

Most likely cause is writing to a pipe which has no reader ... this may be because of the fact that you have not yet programmed a thread/process to read from the pipe or that pipe reader might have exited ...

Author Comment

ID: 9894509
i am not using the pipe,just using only the socket,connect,recv,send i mean the client parts on pthread

Author Comment

ID: 9894840
i think i am getting broken pipe error,when i am trying to send some long data,when i commented that sending long data,it is working i think,but wat the way way to overcome this
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 45

Expert Comment

ID: 9894902
one work around is to fragment data before sending and assemble it at client site

post the code if possible

Accepted Solution

mtmike earned 1000 total points
ID: 9897291
The kernel will send the SIGPIPE signal when the remote end closes or shuts down the socket and you try to send/write. The default signal handler will terminate your program.

One solution is to ignore the signal using 'signal(SIGPIPE, SIG_IGN)' somewhere at the start of your program. You will get an EPIPE error return when send/write fails due to a broken pipe.

Another less portable solution is to pass the MSG_NOSIGNAL flag to send(). This has the same effect.

Author Comment

ID: 9934118
thanks mtmike ,it is the problem,lots of thanks man
and thanks for sunnycoder too,

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question