Comparison

net/connect.lua @ 8549:69e942c2990f

net.connect: Improve error message
author Matthew Wild <mwild1@gmail.com>
date Mon, 26 Feb 2018 15:25:52 +0000
parent 8548:162f75ac2693
child 8550:f841d359da65
comparison
equal deleted inserted replaced
8548:162f75ac2693 8549:69e942c2990f
29 p.target_resolver:next(function (conn_type, ip, port, extra) 29 p.target_resolver:next(function (conn_type, ip, port, extra)
30 if not conn_type then 30 if not conn_type then
31 -- No more targets to try 31 -- No more targets to try
32 p:log("debug", "No more connection targets to try"); 32 p:log("debug", "No more connection targets to try");
33 if p.listeners.onfail then 33 if p.listeners.onfail then
34 p.listeners.onfail(p.data, p.last_error or "unable to connect to service"); 34 p.listeners.onfail(p.data, p.last_error or "unable to resolve service");
35 end 35 end
36 return; 36 return;
37 end 37 end
38 p:log("debug", "Next target to try is %s:%d", ip, port); 38 p:log("debug", "Next target to try is %s:%d", ip, port);
39 local conn, err = server.addclient(ip, port, pending_connection_listeners, p.options.pattern or "*a", p.options.sslctx, conn_type, extra); 39 local conn, err = server.addclient(ip, port, pending_connection_listeners, p.options.pattern or "*a", p.options.sslctx, conn_type, extra);