Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


When will my application receive SIGPIPE?



When will my application receive SIGPIPE?..

Answer / chaitanya

Very simple: with TCP you get SIGPIPE if your end of the connection has received an RST from the other end. What this also means is that if you were using select instead of write, the select would have indicated the socket as being readable, since the RST is there for you to read (read will return an error with errno set to ECONNRESET).

Basically an RST is TCP's response to some packet that it doesn't expect and has no other way of dealing with. A common case is when the peer closes the connection (sending you a FIN) but you ignore it because you're writing and not reading. (You should be using select.) So you write to a connection that has been closed by the other end and the oether end's TCP responds with an RST.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Unix Socket Programming Interview Questions

How often should I re-transmit un-acknowleged messages?

1 Answers  


How do unix sockets work?

0 Answers  


Why do I keep getting EINTR from the socket calls?

1 Answers  


system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?

0 Answers  


Is socket a hardware or software?

0 Answers  


How many socket connections can a server handle?

0 Answers  


How do Sockets Work?

1 Answers  


Why sockets are used?

0 Answers  


How does a socket work?

0 Answers  


What is the difference between SO_REUSEADDR and SO_REUSEPORT?

0 Answers  


How to find other end of unix socket connection?

0 Answers  


How come I get address already in use from bind()?

1 Answers  


Categories