Class: CrapServer::Configure

Inherits:
Object
  • Object
show all
Defined in:
lib/crap_server/configure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfigure

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_connectionObject

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_fileObject

The file to use as log



17
18
19
# File 'lib/crap_server/configure.rb', line 17

def log_file
  @log_file
end

#log_levelObject

The log level used



19
20
21
# File 'lib/crap_server/configure.rb', line 19

def log_level
  @log_level
end

#max_pending_connectionsObject

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_sizeObject

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

#portObject

The port used. Default: 7331



5
6
7
# File 'lib/crap_server/configure.rb', line 5

def port
  @port
end

#read_buffer_sizeObject

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