Reputation: 967
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
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