Solved

Broken Pipe Error.

Posted on 2003-12-07
6
50,841 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
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 ...
0
 

Author Comment

by:hirosh
ID: 9894509
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
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
anyway,
regards
 
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 45

Expert Comment

by:sunnycoder
ID: 9894902
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
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.
0
 

Author Comment

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

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

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 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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 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