init.lua

changeset 382
479b856a910f
parent 368
154c2f04d73b
child 385
e6bf19ad5c19
equal deleted inserted replaced
381:65533afab352 382:479b856a910f
117 connect_port = tonumber(connect_port) or 5222; 117 connect_port = tonumber(connect_port) or 5222;
118 118
119 -- Create and initiate connection 119 -- Create and initiate connection
120 local conn = socket.tcp() 120 local conn = socket.tcp()
121 conn:settimeout(0); 121 conn:settimeout(0);
122 conn:setoption("keepalive", true);
122 local success, err = conn:connect(connect_host, connect_port); 123 local success, err = conn:connect(connect_host, connect_port);
123 124
124 if not success and err ~= "timeout" then 125 if not success and err ~= "timeout" then
125 self:warn("connect() to %s:%d failed: %s", connect_host, connect_port, err); 126 self:warn("connect() to %s:%d failed: %s", connect_host, connect_port, err);
126 return self:event("disconnected", { reason = err }) or false, err; 127 return self:event("disconnected", { reason = err }) or false, err;

mercurial