Broken Pipe Error.

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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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 ...
hiroshAuthor Commented:
i am not using the pipe,just using only the socket,connect,recv,send i mean the client parts on pthread
hiroshAuthor Commented:
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
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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

post the code if possible
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hiroshAuthor Commented:
thanks mtmike ,it is the problem,lots of thanks man
and thanks for sunnycoder too,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux OS Dev

From novice to tech pro — start learning today.