Comparison

net/server.lua @ 1297:9c8f86a3878d

net.server: Display server port in error messages
author Matthew Wild <mwild1@gmail.com>
date Thu, 04 Jun 2009 15:22:04 +0100
parent 1214:27d4cfb8fb7a
child 1522:569d58d21612
comparison
equal deleted inserted replaced
1296:5cf4c444d3f9 1297:9c8f86a3878d
651 err = "listeners on port '" .. port .. "' already exist" 651 err = "listeners on port '" .. port .. "' already exist"
652 elseif sslctx and not luasec then 652 elseif sslctx and not luasec then
653 err = "luasec not found" 653 err = "luasec not found"
654 end 654 end
655 if err then 655 if err then
656 out_error( "server.lua: ", err ) 656 out_error( "server.lua, port ", port, ": ", err )
657 return nil, err 657 return nil, err
658 end 658 end
659 addr = addr or "*" 659 addr = addr or "*"
660 local server, err = socket_bind( addr, port ) 660 local server, err = socket_bind( addr, port )
661 if err then 661 if err then
662 out_error( "server.lua: ", err ) 662 out_error( "server.lua, port ", port, ": ", err )
663 return nil, err 663 return nil, err
664 end 664 end
665 local handler, err = wrapserver( listeners, server, addr, port, pattern, sslctx, maxconnections, startssl ) -- wrap new server socket 665 local handler, err = wrapserver( listeners, server, addr, port, pattern, sslctx, maxconnections, startssl ) -- wrap new server socket
666 if not handler then 666 if not handler then
667 server:close( ) 667 server:close( )