diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-05-05 15:21:17 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-05-05 15:21:17 +0100 |
commit | c51d0beea7af41fd615cb11640a2a6bb0fcf1aab (patch) | |
tree | fe15a9bda9db6cc20ecce075af90d8abd3f0d649 /net/server_event.lua | |
parent | 93b148715f75aa29947fa3181cdf22d8209431a8 (diff) | |
download | prosody-c51d0beea7af41fd615cb11640a2a6bb0fcf1aab.tar.gz prosody-c51d0beea7af41fd615cb11640a2a6bb0fcf1aab.zip |
net.server_select, net.server_event: Support for :pause() and :resume() on connections
Diffstat (limited to 'net/server_event.lua')
-rw-r--r-- | net/server_event.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/net/server_event.lua b/net/server_event.lua index dde13e61..c28c5ce2 100644 --- a/net/server_event.lua +++ b/net/server_event.lua @@ -282,8 +282,21 @@ do return nointerface, noreading, nowriting end + --TODO: Deprecate function interface_mt:lock_read(switch) - return self:_lock(self.nointerface, switch, self.nowriting); + if switch then + return self:pause(); + else + return self:resume(); + end + end + + function interface_mt:pause() + return self:_lock(self.nointerface, true, self.nowriting); + end + + function interface_mt:resume() + return self:_lock(self.nointerface, false, self.nowriting); end function interface_mt:counter(c) |