Comparison

net/adns.lua @ 886:96de7f0a41cc

net.adns: Set new send in net.server after 'connecting UDP' socket
author Matthew Wild <mwild1@gmail.com>
date Sat, 07 Mar 2009 19:57:28 +0000
parent 872:24018ba2f7c0
child 973:b091a1a7273b
comparison
equal deleted inserted replaced
885:38ed2db19a55 886:96de7f0a41cc
27 function listener.disconnect() 27 function listener.disconnect()
28 end 28 end
29 newconn.handler, newconn._socket = server.wrapclient(sock, "dns", 53, listener); 29 newconn.handler, newconn._socket = server.wrapclient(sock, "dns", 53, listener);
30 newconn.handler.settimeout = function () end 30 newconn.handler.settimeout = function () end
31 newconn.handler.setsockname = function (_, ...) return sock:setsockname(...); end 31 newconn.handler.setsockname = function (_, ...) return sock:setsockname(...); end
32 newconn.handler.setpeername = function (_, ...) return sock:setpeername(...); end 32 newconn.handler.setpeername = function (_, ...) local ret = sock:setpeername(...); _.setsend(sock.send); return ret; end
33 newconn.handler.connect = function (_, ...) return sock:connect(...) end 33 newconn.handler.connect = function (_, ...) return sock:connect(...) end
34 newconn.handler.send = function (_, data) return _.write(data) end 34 newconn.handler.send = function (_, data) return _.write(data) end
35 return newconn.handler; 35 return newconn.handler;
36 end 36 end
37 37