Comparison

net/connect.lua @ 8546:d66916dc318a

net.connect: Track last connection error
author Matthew Wild <mwild1@gmail.com>
date Mon, 26 Feb 2018 15:20:35 +0000
parent 8536:c3f234e4ac23
child 8547:5e9c87376891
comparison
equal deleted inserted replaced
8545:248bab2bd0c9 8546:d66916dc318a
54 local p = pending_connections_map[conn]; 54 local p = pending_connections_map[conn];
55 if not p then 55 if not p then
56 log("warn", "Failed connection, but unexpected!"); 56 log("warn", "Failed connection, but unexpected!");
57 return; 57 return;
58 end 58 end
59 p:log("debug", "Connection attempt failed"); 59 p.last_error = reason or "unknown reason";
60 p:log("debug", "Connection attempt failed: %s", p.last_error);
60 attempt_connection(p); 61 attempt_connection(p);
61 end 62 end
62 63
63 local function connect(target_resolver, listeners, options, data) 64 local function connect(target_resolver, listeners, options, data)
64 local p = setmetatable({ 65 local p = setmetatable({