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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How does unix socket work?

904


What is the purpose of socket?

912


What is active unix domain sockets?

899


How do I convert a string into an internet address?

1373


What are the types of sockets?

922


What's the difference between impact sockets and regular sockets?

854


Why does it take so long to detect that the peer died?

1510


How can I force a socket to send the data in its buffer?

1606


Can a socket have multiple ports?

861


How many sockets can a port have?

858


What is the difference between read() and recv()?

1961


Why do we need sockets?

820


Can a single socket port be used for multiple applications?

880


How can I set the timeout for the connect() system call?

1506


What exactly is a socket?

922