Software /
code /
prosody
Comparison
net/server.lua @ 1100:05d209ef9661
Merge with 0.4
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 03 May 2009 01:11:21 +0100 |
parent | 1039:cc4280f45d0e |
parent | 1098:37ea264e133d |
child | 1214:27d4cfb8fb7a |
comparison
equal
deleted
inserted
replaced
1088:7cf44a5c0991 | 1100:05d209ef9661 |
---|---|
75 local stats | 75 local stats |
76 local idfalse | 76 local idfalse |
77 local addtimer | 77 local addtimer |
78 local closeall | 78 local closeall |
79 local addserver | 79 local addserver |
80 local getserver | |
80 local wrapserver | 81 local wrapserver |
81 local getsettings | 82 local getsettings |
82 local closesocket | 83 local closesocket |
83 local removesocket | 84 local removesocket |
84 local removeserver | 85 local removeserver |
668 _socketlist[ server ] = handler | 669 _socketlist[ server ] = handler |
669 out_put( "server.lua: new server listener on '", addr, ":", port, "'" ) | 670 out_put( "server.lua: new server listener on '", addr, ":", port, "'" ) |
670 return handler | 671 return handler |
671 end | 672 end |
672 | 673 |
674 getserver = function ( port ) | |
675 return _server[ port ]; | |
676 end | |
677 | |
673 removeserver = function( port ) | 678 removeserver = function( port ) |
674 local handler = _server[ port ] | 679 local handler = _server[ port ] |
675 if not handler then | 680 if not handler then |
676 return nil, "no server found on port '" .. tostring( port ) "'" | 681 return nil, "no server found on port '" .. tostring( port ) "'" |
677 end | 682 end |
726 | 731 |
727 stats = function( ) | 732 stats = function( ) |
728 return _readtraffic, _sendtraffic, _readlistlen, _sendlistlen, _timerlistlen | 733 return _readtraffic, _sendtraffic, _readlistlen, _sendlistlen, _timerlistlen |
729 end | 734 end |
730 | 735 |
731 local dontstop = true; | 736 local dontstop = true; -- thinking about tomorrow, ... |
732 | 737 |
733 setquitting = function (quit) | 738 setquitting = function (quit) |
734 dontstop = not quit; | 739 dontstop = not quit; |
735 return; | 740 return; |
736 end | 741 end |
842 loop = loop, | 847 loop = loop, |
843 stats = stats, | 848 stats = stats, |
844 closeall = closeall, | 849 closeall = closeall, |
845 addtimer = addtimer, | 850 addtimer = addtimer, |
846 addserver = addserver, | 851 addserver = addserver, |
852 getserver = getserver, | |
847 getsettings = getsettings, | 853 getsettings = getsettings, |
848 setquitting = setquitting, | 854 setquitting = setquitting, |
849 removeserver = removeserver, | 855 removeserver = removeserver, |
850 changesettings = changesettings, | 856 changesettings = changesettings, |
851 } | 857 } |