> Hello,
> I have problems with the following source :
> On the server side :
> do {
> iRes = recv(filedesc, bTmp, 3 - iPt, 0);
> iPt += iRes;
> } while(iPt < 3);
> On the client side:
> send(sock, buff, 3, 0);
> I want to retreive 3 bytes in as many tries as necessary. But the send, on
> the client side, exits with a "broken pipe".
That means your server has exited.
There are two approaches to face this.
1] Keep a signal handler for SIGPIPE and do the required .
OR
2] Ignore SIGPIPE by signal(SIGPIPE, SIG_IGN) and handle the EPIPE error which
was returned due to send().
The second one is preferable.
Quote:> Could someone help me with this
> problem please? I'm not too familiar with network programming.
No problem....More doubts on unix network programming are welcome here.
--
Nithyanand.
Siemens, Bangalore, India.
(Opinions expressed are my own and do not reflect the opinions of my employer,
Siemens)