-
Notifications
You must be signed in to change notification settings - Fork 7
Labels
Description
Consider this trivial snippet:
#include "../src/Client/Connector.hpp"
using Buf_t = tnt::Buffer<16 * 1024>;
using Net_t = LibevNetProvider<Buf_t, DefaultStream>;
int
main()
{
Connector<Buf_t, Net_t> client;
Connection<Buf_t, Net_t> conn(client);
client.close(conn);
}
It crashes with the following assertion:
Assertion failed: (!conn.strm.has_status(SS_DEAD)), function close, file Connector.hpp, line 171.
However, the SS_DEAD
status can be set for a multitude of reasons without the connection being closed or connected. For instance, if the connection was lost or a send
/recv
failed:
tntcxx/src/Client/UnixPlainStream.hpp
Lines 137 to 142 in a3d0414
ssize_t rcvd = recvmsg(get_fd(), &msg, flags); | |
if (rcvd > 0) | |
return rcvd; | |
else if (rcvd == 0) | |
return US_DIE("Peer shutdown"); |
tntcxx/src/Client/UnixPlainStream.hpp
Line 119 in a3d0414
return US_DIE("Send failed", strerror(errno)); |