Solved

Broken Pipe Error.

Posted on 2003-12-07
6
50,786 Views
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
regards
hirosh
0
Comment
Question by:hirosh
  • 3
  • 2
6 Comments
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
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 ...
0
 

Author Comment

by:hirosh
Comment Utility
i am not using the pipe,just using only the socket,connect,recv,send i mean the client parts on pthread
0
 

Author Comment

by:hirosh
Comment Utility
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
anyway,
regards
 
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
one work around is to fragment data before sending and assemble it at client site

post the code if possible
0
 
LVL 5

Accepted Solution

by:
mtmike earned 250 total points
Comment Utility
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.
0
 

Author Comment

by:hirosh
Comment Utility
thanks mtmike ,it is the problem,lots of thanks man
and thanks for sunnycoder too,
regards
hirosh
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now