Merge branch 'master' into es17.01

This commit is contained in:
2017-03-02 10:01:33 +01:00
2 changed files with 34 additions and 13 deletions

View File

@@ -53,8 +53,10 @@ feature -- Access
-- Max number of concurrent connections.
force_single_threaded: BOOLEAN assign set_force_single_threaded
obsolete
"Use directly `max_concurrent_connections = 1` [Feb/2017]"
do
Result := max_concurrent_connections = 0
Result := max_concurrent_connections <= 1
end
is_verbose: BOOLEAN assign set_is_verbose
@@ -198,16 +200,18 @@ feature -- Element change
set_force_single_threaded (v: like force_single_threaded)
-- Force server to handle incoming request in a single thread.
-- i.e set max_concurrent_connections to 0!
-- i.e set max_concurrent_connections to 1!
obsolete
"Use set_max_concurrent_connections (0) [June/2016]"
"Use set_max_concurrent_connections (1) [June/2016]"
do
if v then
set_max_concurrent_connections (0)
set_max_concurrent_connections (1)
else
set_max_concurrent_connections (default_max_concurrent_connections)
end
--|Missing postcondition
--| force_single_thread_set: v implies max_concurrent_connections = 0
--| not_single_thread: not v implies max_concurrent_connections > 0
ensure
force_single_threaded_set: v implies max_concurrent_connections <= 1
not_single_threaded: not v implies max_concurrent_connections > 1
end
set_is_verbose (b: BOOLEAN)

View File

@@ -9,7 +9,7 @@ note
port: numeric such as 8099 (or equivalent string as "8099")
base: base_url (very specific to standalone server)
max_concurrent_connections: set one, for single threaded behavior
max_concurrent_connections: set to 1, for single threaded behavior
max_tcp_clients: max number of open tcp connection
socket_timeout: connection timeout
@@ -106,7 +106,8 @@ feature {NONE} -- Initialization
port_number := opts.option_integer_value ("port", port_number)
if opts.option_boolean_value ("force_single_threaded", False) then
force_single_threaded
-- Obsolete: keep for backward compatibility with obsolete Nino connector.
set_max_concurrent_connections (1)
end
max_concurrent_connections := opts.option_integer_value ("max_concurrent_connections", max_concurrent_connections)
max_tcp_clients := opts.option_integer_value ("max_tcp_clients", max_tcp_clients)
@@ -139,10 +140,24 @@ feature {NONE} -- Initialization
force_single_threaded
-- Set `single_threaded' to True.
obsolete
"Use set_max_concurrent_connections (1) [Feb/2017]"
do
max_concurrent_connections := 1
set_max_concurrent_connections (1)
ensure
single_threaded: single_threaded
end
set_max_concurrent_connections (v: like max_concurrent_connections)
-- Set `max_concurrent_connections` to `v`.
require
v_positive_or_zero: v >= 0
do
max_concurrent_connections := v
ensure
max_concurrent_connections_set : max_concurrent_connections = v
end
feature -- Execution
update_configuration (cfg: like connector.configuration)
@@ -162,7 +177,7 @@ feature -- Execution
launch
-- <Precursor/>
-- using `port_number', `base_url', `verbose' and `single_threaded'
-- using associated settings/configuration.
local
conn: like connector
do
@@ -219,11 +234,13 @@ feature {NONE} -- Implementation
-- Help defining the verbosity.
-- The higher, the more output.
max_concurrent_connections: INTEGER
max_concurrent_connections: INTEGER assign set_max_concurrent_connections
single_threaded: BOOLEAN
obsolete
"Use max_concurrent_connections <= 1 [Feb/2017]"
do
Result := max_concurrent_connections = 0
Result := max_concurrent_connections <= 1
end
max_tcp_clients: INTEGER