Software /
code /
prosody
Comparison
net/server_select.lua @ 2968:fdd049a4e551
Merge 0.6->0.7
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 09 Apr 2010 12:31:51 +0100 |
parent | 2967:net/server.lua@c39ad633b26d |
parent | 2925:net/server.lua@692b3c6c5bd2 |
child | 2970:9b8e139eff5f |
comparison
equal
deleted
inserted
replaced
2964:49b5c87d2fa0 | 2968:fdd049a4e551 |
---|---|
659 addserver = function( addr, port, listeners, pattern, sslctx ) -- this function provides a way for other scripts to reg a server | 659 addserver = function( addr, port, listeners, pattern, sslctx ) -- this function provides a way for other scripts to reg a server |
660 local err | 660 local err |
661 if type( listeners ) ~= "table" then | 661 if type( listeners ) ~= "table" then |
662 err = "invalid listener table" | 662 err = "invalid listener table" |
663 end | 663 end |
664 if not type( port ) == "number" or not ( port >= 0 and port <= 65535 ) then | 664 if type( port ) ~= "number" or not ( port >= 0 and port <= 65535 ) then |
665 err = "invalid port" | 665 err = "invalid port" |
666 elseif _server[ port ] then | 666 elseif _server[ port ] then |
667 err = "listeners on port '" .. port .. "' already exist" | 667 err = "listeners on port '" .. port .. "' already exist" |
668 elseif sslctx and not luasec then | 668 elseif sslctx and not luasec then |
669 err = "luasec not found" | 669 err = "luasec not found" |