Software /
code /
prosody
Comparison
net/server_select.lua @ 4399:1b4161970842
net.server_event, net.server_select: Fixed some global pollution.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Fri, 14 Oct 2011 00:46:29 +0500 |
parent | 4393:7958680c459a |
child | 4429:8e02ba75ef06 |
comparison
equal
deleted
inserted
replaced
4398:acc37e221940 | 4399:1b4161970842 |
---|---|
779 return _readtraffic, _sendtraffic, _readlistlen, _sendlistlen, _timerlistlen | 779 return _readtraffic, _sendtraffic, _readlistlen, _sendlistlen, _timerlistlen |
780 end | 780 end |
781 | 781 |
782 local quitting; | 782 local quitting; |
783 | 783 |
784 setquitting = function (quit) | 784 local function setquitting(quit) |
785 quitting = not not quit; | 785 quitting = not not quit; |
786 end | 786 end |
787 | 787 |
788 loop = function(once) -- this is the main loop of the program | 788 loop = function(once) -- this is the main loop of the program |
789 if quitting then return "quitting"; end | 789 if quitting then return "quitting"; end |
830 until quitting; | 830 until quitting; |
831 if once and quitting == "once" then quitting = nil; return; end | 831 if once and quitting == "once" then quitting = nil; return; end |
832 return "quitting" | 832 return "quitting" |
833 end | 833 end |
834 | 834 |
835 step = function () | 835 local function step() |
836 return loop(true); | 836 return loop(true); |
837 end | 837 end |
838 | 838 |
839 local function get_backend() | 839 local function get_backend() |
840 return "select"; | 840 return "select"; |