Comparison

net/server_select.lua @ 5663:4e51ceee469c

net.server_select: Make sure there is a server to pause when hitting maxfd (Thanks elghinn)
author Kim Alvefur <zash@zash.se>
date Sun, 09 Jun 2013 17:00:26 +0200
parent 5642:5862bb57a3f1
child 5664:4f499eb63c04
child 5949:a9abbdeddbf3
comparison
equal deleted inserted replaced
5650:aa3465183b01 5663:4e51ceee469c
261 wrapconnection = function( server, listeners, socket, ip, serverport, clientport, pattern, sslctx ) -- this function wraps a client to a handler object 261 wrapconnection = function( server, listeners, socket, ip, serverport, clientport, pattern, sslctx ) -- this function wraps a client to a handler object
262 262
263 if socket:getfd() >= _maxfd then 263 if socket:getfd() >= _maxfd then
264 out_error("server.lua: Disallowed FD number: "..socket:getfd()) -- PROTIP: Switch to libevent 264 out_error("server.lua: Disallowed FD number: "..socket:getfd()) -- PROTIP: Switch to libevent
265 socket:close( ) -- Should we send some kind of error here? 265 socket:close( ) -- Should we send some kind of error here?
266 server.pause( ) 266 if server then
267 server.pause( )
268 end
267 return nil, nil, "fd-too-large" 269 return nil, nil, "fd-too-large"
268 end 270 end
269 socket:settimeout( 0 ) 271 socket:settimeout( 0 )
270 272
271 --// local import of socket methods //-- 273 --// local import of socket methods //--