0
# Connector handling the connections to the clients.
0
attr_accessor :connector
0
- # Sets the maximum number of file or socket descriptors that your process may open.
0
- attr_accessor :descriptor_table_size
0
+ # Maximum number of file or socket descriptors that the server may open.
0
+ attr_reader :descriptor_table_size
0
# Maximum number of seconds for incoming data to arrive before the connection
0
new(*args, &block).start!
0
+ # Set the maximum number of socket descriptors that the server may open.
0
+ # The process needs to have required privilege to set it higher the 1024 on
0
+ def descriptor_table_size=(size)
0
+ @descriptor_table_size = EventMachine.set_descriptor_table_size(size)
0
+ log ">> Setting descriptor table size to #{@descriptor_table_size}"
0
+ if @descriptor_table_size < size
0
+ log "!! descriptor table size smaller then requested, " +
0
+ "run with sudo to set higher"
0
+ @descriptor_table_size
0
# Start the server and listen for connections.
0
# Also register signals:
0
# * INT calls +stop+ to shutdown gracefully.
0
log ">> Thin web server (v#{VERSION::STRING} codename #{VERSION::CODENAME})"
0
debug ">> Debugging ON"
0
- set_descriptor_table_size
0
log ">> Listening on #{@connector}, CTRL+C to stop"
0
log ">> Waiting for #{@connector.size} connection(s) to finish, can take up to #{timeout} sec, CTRL+C to stop now"
0
- def set_descriptor_table_size
0
- requested_descriptor_table_size = @descriptor_table_size || 4096
0
- @descriptor_table_size = EventMachine.set_descriptor_table_size(requested_descriptor_table_size)
0
- log ">> Setting descriptor table size to #{@descriptor_table_size}"
0
- if @descriptor_table_size < requested_descriptor_table_size
0
- log "!! descriptor table size smaller then requested, " +
0
- "run with sudo privileges to set higher"
0
- @descriptor_table_size
Comments
No one has commented yet.