parent
ea4917d4d0
commit
9d6b34c73a
2 changed files with 30 additions and 1 deletions
|
@ -216,7 +216,14 @@ TCPConnection connectTCP(NetworkAddress addr, NetworkAddress bind_address = anyA
|
|||
|
||||
enforce(!cancelled, "Failed to connect to " ~ addr.toString() ~
|
||||
": timeout");
|
||||
enforce(status == ConnectStatus.connected, "Failed to connect to "~addr.toString()~": "~status.to!string);
|
||||
|
||||
if (status != ConnectStatus.connected) {
|
||||
if (sock != SocketFD.invalid)
|
||||
assert(!eventDriver.sockets.releaseRef(sock));
|
||||
|
||||
enforce(false, "Failed to connect to "~addr.toString()~": "~status.to!string);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return TCPConnection(sock, uaddr);
|
||||
} ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue