Merge branch 'master' into es17.01
This commit is contained in:
@@ -53,8 +53,10 @@ feature -- Access
|
|||||||
-- Max number of concurrent connections.
|
-- Max number of concurrent connections.
|
||||||
|
|
||||||
force_single_threaded: BOOLEAN assign set_force_single_threaded
|
force_single_threaded: BOOLEAN assign set_force_single_threaded
|
||||||
|
obsolete
|
||||||
|
"Use directly `max_concurrent_connections = 1` [Feb/2017]"
|
||||||
do
|
do
|
||||||
Result := max_concurrent_connections = 0
|
Result := max_concurrent_connections <= 1
|
||||||
end
|
end
|
||||||
|
|
||||||
is_verbose: BOOLEAN assign set_is_verbose
|
is_verbose: BOOLEAN assign set_is_verbose
|
||||||
@@ -198,16 +200,18 @@ feature -- Element change
|
|||||||
|
|
||||||
set_force_single_threaded (v: like force_single_threaded)
|
set_force_single_threaded (v: like force_single_threaded)
|
||||||
-- Force server to handle incoming request in a single thread.
|
-- 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
|
obsolete
|
||||||
"Use set_max_concurrent_connections (0) [June/2016]"
|
"Use set_max_concurrent_connections (1) [June/2016]"
|
||||||
do
|
do
|
||||||
if v then
|
if v then
|
||||||
set_max_concurrent_connections (0)
|
set_max_concurrent_connections (1)
|
||||||
|
else
|
||||||
|
set_max_concurrent_connections (default_max_concurrent_connections)
|
||||||
end
|
end
|
||||||
--|Missing postcondition
|
ensure
|
||||||
--| force_single_thread_set: v implies max_concurrent_connections = 0
|
force_single_threaded_set: v implies max_concurrent_connections <= 1
|
||||||
--| not_single_thread: not v implies max_concurrent_connections > 0
|
not_single_threaded: not v implies max_concurrent_connections > 1
|
||||||
end
|
end
|
||||||
|
|
||||||
set_is_verbose (b: BOOLEAN)
|
set_is_verbose (b: BOOLEAN)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ note
|
|||||||
port: numeric such as 8099 (or equivalent string as "8099")
|
port: numeric such as 8099 (or equivalent string as "8099")
|
||||||
base: base_url (very specific to standalone server)
|
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
|
max_tcp_clients: max number of open tcp connection
|
||||||
|
|
||||||
socket_timeout: connection timeout
|
socket_timeout: connection timeout
|
||||||
@@ -106,7 +106,8 @@ feature {NONE} -- Initialization
|
|||||||
port_number := opts.option_integer_value ("port", port_number)
|
port_number := opts.option_integer_value ("port", port_number)
|
||||||
|
|
||||||
if opts.option_boolean_value ("force_single_threaded", False) then
|
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
|
end
|
||||||
max_concurrent_connections := opts.option_integer_value ("max_concurrent_connections", max_concurrent_connections)
|
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)
|
max_tcp_clients := opts.option_integer_value ("max_tcp_clients", max_tcp_clients)
|
||||||
@@ -139,8 +140,22 @@ feature {NONE} -- Initialization
|
|||||||
|
|
||||||
force_single_threaded
|
force_single_threaded
|
||||||
-- Set `single_threaded' to True.
|
-- Set `single_threaded' to True.
|
||||||
|
obsolete
|
||||||
|
"Use set_max_concurrent_connections (1) [Feb/2017]"
|
||||||
do
|
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
|
end
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
@@ -162,7 +177,7 @@ feature -- Execution
|
|||||||
|
|
||||||
launch
|
launch
|
||||||
-- <Precursor/>
|
-- <Precursor/>
|
||||||
-- using `port_number', `base_url', `verbose' and `single_threaded'
|
-- using associated settings/configuration.
|
||||||
local
|
local
|
||||||
conn: like connector
|
conn: like connector
|
||||||
do
|
do
|
||||||
@@ -219,11 +234,13 @@ feature {NONE} -- Implementation
|
|||||||
-- Help defining the verbosity.
|
-- Help defining the verbosity.
|
||||||
-- The higher, the more output.
|
-- The higher, the more output.
|
||||||
|
|
||||||
max_concurrent_connections: INTEGER
|
max_concurrent_connections: INTEGER assign set_max_concurrent_connections
|
||||||
|
|
||||||
single_threaded: BOOLEAN
|
single_threaded: BOOLEAN
|
||||||
|
obsolete
|
||||||
|
"Use max_concurrent_connections <= 1 [Feb/2017]"
|
||||||
do
|
do
|
||||||
Result := max_concurrent_connections = 0
|
Result := max_concurrent_connections <= 1
|
||||||
end
|
end
|
||||||
|
|
||||||
max_tcp_clients: INTEGER
|
max_tcp_clients: INTEGER
|
||||||
|
|||||||
Reference in New Issue
Block a user