Solved incorrect behaviour of writev in case the first send succeeded and the second returned with an error.