Software /
code /
prosody
Comparison
net/server.lua @ 2105:fecf33cb2913
net.server: Small fix for addtimer() compatibility code
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 21 Nov 2009 17:13:21 +0000 |
parent | 2094:c69cb5c171e0 |
child | 2136:23c687039652 |
comparison
equal
deleted
inserted
replaced
2104:466bd2cac62a | 2105:fecf33cb2913 |
---|---|
7 server = require "net.server_event"; | 7 server = require "net.server_event"; |
8 package.loaded["net.server"] = server; | 8 package.loaded["net.server"] = server; |
9 | 9 |
10 -- Backwards compatibility for timers, addtimer | 10 -- Backwards compatibility for timers, addtimer |
11 -- called a function roughly every second | 11 -- called a function roughly every second |
12 local add_task = require "util.timer"; | 12 local add_task = require "util.timer".add_task; |
13 function server.addtimer(f) | 13 function server.addtimer(f) |
14 return add_task(1, function (...) f(...); return 1; end); | 14 return add_task(1, function (...) f(...); return 1; end); |
15 end | 15 end |
16 else | 16 else |
17 server = require "net.server_select"; | 17 server = require "net.server_select"; |