Class: CrapServer::Configure
- Inherits:
-
Object
- Object
- CrapServer::Configure
- Defined in:
- lib/crap_server/configure.rb
Instance Attribute Summary collapse
-
#auto_close_connection ⇒ Object
Set to false if you want to manage the close of the connection.
-
#log_file ⇒ Object
The file to use as log.
-
#log_level ⇒ Object
The log level used.
-
#max_pending_connections ⇒ Object
The number of maximum penning connections.
-
#pool_size ⇒ Object
Thread pool size.
-
#port ⇒ Object
The port used.
-
#read_buffer_size ⇒ Object
Max read buffer size Default: 16K.
Instance Method Summary collapse
-
#initialize ⇒ Configure
constructor
A new instance of Configure.
Constructor Details
#initialize ⇒ Configure
Returns a new instance of Configure.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/crap_server/configure.rb', line 22 def initialize @port = 7331 @manual_read = false @read_buffer_size = 1024*16 # 16K for read buffer @max_pending_connections = Socket::SOMAXCONN @method = :non_blocking @auto_close_connection = true @log_file = STDOUT @log_level = Logger::DEBUG @pool_size = 10 end |
Instance Attribute Details
#auto_close_connection ⇒ Object
Set to false if you want to manage the close of the connection. Note that this require manual_read set to true. DEPERCATED
15 16 17 |
# File 'lib/crap_server/configure.rb', line 15 def auto_close_connection @auto_close_connection end |
#log_file ⇒ Object
The file to use as log
17 18 19 |
# File 'lib/crap_server/configure.rb', line 17 def log_file @log_file end |
#log_level ⇒ Object
The log level used
19 20 21 |
# File 'lib/crap_server/configure.rb', line 19 def log_level @log_level end |
#max_pending_connections ⇒ Object
The number of maximum penning connections. Default: Max allowed by the OS
11 12 13 |
# File 'lib/crap_server/configure.rb', line 11 def max_pending_connections @max_pending_connections end |
#pool_size ⇒ Object
Thread pool size. 10 per cor by default
21 22 23 |
# File 'lib/crap_server/configure.rb', line 21 def pool_size @pool_size end |
#port ⇒ Object
The port used. Default: 7331
5 6 7 |
# File 'lib/crap_server/configure.rb', line 5 def port @port end |
#read_buffer_size ⇒ Object
Max read buffer size Default: 16K
8 9 10 |
# File 'lib/crap_server/configure.rb', line 8 def read_buffer_size @read_buffer_size end |