eddy ed
eddy ed

Reputation: 967

C - effect of a write() to a closed tcp connection when using signal(SIGPIPE, SIG_IGN);

By closed connection I mean that the other end closed it gracefully. I would expect to receive a 0 from the write() as returned value, but please correct me if I am wrong.

Upvotes: 0

Views: 98

Answers (1)

torek
torek

Reputation: 488183

Exact behavior may depend on underlying OS but in general you should get an error, i.e., write will return -1 and set errno (to ECONNRESET for instance).

Upvotes: 1

Related Questions