send() crash the whole problem if the receiver no longer exi

If the Server issues a send(), and the Client is already terminated, my
Server problem crashes, and a broken pipe message is displayed…how can I
avoid this?? Should I use Select() to tell if the Client still
exist? even if the select or other function can tel that, what if client
dies after that function cal…and right before my send()…?

You can handle SIGPIPE or you can ignore it:
signal(SIGPIPE, SIG_IGN);

The latter will let the send fail normally with errno
set to EPIPE.

-seanb

ran zhang <rzhang@vamcointernational.com> wrote:
: If the Server issues a send(), and the Client is already terminated, my
: Server problem crashes, and a broken pipe message is displayed…how can I
: avoid this?? Should I use Select() to tell if the Client still
: exist? even if the select or other function can tel that, what if client
: dies after that function cal…and right before my send()…?

Your tip wrks great!.. I’m a newbie. I’m concerned that if there is any
other disastrous results
that happen…I’m just writing a very general protocol… using basic ‘bind’,
‘send’, ‘recv’…
My concern is just if ther any situation that those simple calls can cause
disastrous results like ‘send’ jsut did.
thank you. (I dont care if data gets lost, or connection is lost , just
anything that can cause major problem)


ran





Sean Boudreau <seanb@qnx.com> wrote in message
news:a41a7u$khf$1@nntp.qnx.com

You can handle SIGPIPE or you can ignore it:
signal(SIGPIPE, SIG_IGN);

The latter will let the send fail normally with errno
set to EPIPE.

-seanb

ran zhang <> rzhang@vamcointernational.com> > wrote:
: If the Server issues a send(), and the Client is already terminated, my
: Server problem crashes, and a broken pipe message is displayed…how can
I
: avoid this?? Should I use Select() to tell if the Client
still
: exist? even if the select or other function can tel that, what if
client
: dies after that function cal…and right before my send()…?
\

ran zhang wrote:

Your tip wrks great!.. I’m a newbie. I’m concerned that if there is any
other disastrous results
that happen…I’m just writing a very general protocol… using basic ‘bind’,
‘send’, ‘recv’…
My concern is just if ther any situation that those simple calls can cause
disastrous results like ‘send’ jsut did.
thank you. (I dont care if data gets lost, or connection is lost , just
anything that can cause major problem)

Your questions are generic TCP/IP questions. You may find a lot of
useful information at http://www.developerweb.net/sock-faq/.