Clusters
SERVER
+
Point of view
All features
ANY
All features
deferred class SERVER [C_ ->
CONNECTION
]
Summary
top
A standard server. Abstracts out most of the nitty-gritty.
Direct parents
Insert list:
ANY
Known children
Insert list:
HTTP_SERVER
,
MULTIPLEX_SERVER
Overview
top
Features
Access
{
ANY
}
start
(a_access:
ACCESS
)
Launch a
Current
using the given
a_access
point.
start_in_stack
(a_access:
ACCESS
, a_stack:
LOOP_STACK
, a_shutdown_handler:
PROCEDURE
[
TUPLE
[TUPLE 1[SERVER [C_ ->
CONNECTION
]]]]):
BOOLEAN
Assing
a_shutdown_handler
as
shutdown_handler
and start
Current
using
a_access
in the given
a_stack
.
set_logger
(a_logger:
PROCEDURE
[
TUPLE 1
[
ABSTRACT_STRING
]])
Assign
logger
with the value of
a_logger
log
(a_message:
ABSTRACT_STRING
)
Write
a_message
in the
logger
, if any.
Implementation
{}
logger
:
PROCEDURE
[
TUPLE 1
[
ABSTRACT_STRING
]]
Used to log message
standalone_handler_agent
:
PROCEDURE
[
TUPLE
[TUPLE 1[SERVER [C_ ->
CONNECTION
]]]]
An Agent to be use to launch
standalone_shutdown
common_start
(a_access:
ACCESS
):
BOOLEAN
Start
Current
using
a_access
.
handle_error
(a_error_message:
STRING
)
What to do when there was an error with message
a_error_message
new_connection
: C_
Create a new connection
stack
:
LOOP_STACK
Used to loop between connections
server_job
:
SOCKET_SERVER_JOB
A job use in
Current
connections
:
INTEGER_32
The number of {
CONNECTION
} in
Current
shutdown_handler
:
PROCEDURE
[
TUPLE
[TUPLE 1[SERVER [C_ ->
CONNECTION
]]]]
Agent launched when
Current
is shutdowning
handle_connect
(a_io:
SOCKET_INPUT_OUTPUT_STREAM
)
Handle a connection to the
Current
.
handle_shutdown
(a_server_job:
SOCKET_SERVER_JOB
)
Shutdown gracefully when all connections are closed.
standalone_shutdown
(a_server: SERVER [C_ ->
CONNECTION
])
Force
Current
to shutdown.
start
(a_access:
ACCESS
)
effective procedure
{
ANY
}
top
Launch a
Current
using the given
a_access
point.
start_in_stack
(a_access:
ACCESS
, a_stack:
LOOP_STACK
, a_shutdown_handler:
PROCEDURE
[
TUPLE
[TUPLE 1[SERVER [C_ ->
CONNECTION
]]]]):
BOOLEAN
effective function
{
ANY
}
top
Assing
a_shutdown_handler
as
shutdown_handler
and start
Current
using
a_access
in the given
a_stack
.
True if
Current
effectively started. Note that is function is not pure (has side effects on
Current
)
ensure
shutdown_handler
= a_shutdown_handler
stack
= a_stack
set_logger
(a_logger:
PROCEDURE
[
TUPLE 1
[
ABSTRACT_STRING
]])
effective procedure
{
ANY
}
top
Assign
logger
with the value of
a_logger
ensure
logger
= a_logger
log
(a_message:
ABSTRACT_STRING
)
effective procedure
{
ANY
}
top
Write
a_message
in the
logger
, if any.
logger
:
PROCEDURE
[
TUPLE 1
[
ABSTRACT_STRING
]]
writable attribute
{}
top
Used to log message
standalone_handler_agent
:
PROCEDURE
[
TUPLE
[TUPLE 1[SERVER [C_ ->
CONNECTION
]]]]
effective function
{}
top
An Agent to be use to launch
standalone_shutdown
common_start
(a_access:
ACCESS
):
BOOLEAN
effective function
{}
top
Start
Current
using
a_access
.
handle_error
(a_error_message:
STRING
)
deferred procedure
{}
top
What to do when there was an error with message
a_error_message
new_connection
: C_
deferred function
{}
top
Create a new connection
stack
:
LOOP_STACK
writable attribute
{}
top
Used to loop between connections
server_job
:
SOCKET_SERVER_JOB
writable attribute
{}
top
A job use in
Current
connections
:
INTEGER_32
writable attribute
{}
top
The number of {
CONNECTION
} in
Current
shutdown_handler
:
PROCEDURE
[
TUPLE
[TUPLE 1[SERVER [C_ ->
CONNECTION
]]]]
writable attribute
{}
top
Agent launched when
Current
is shutdowning
handle_connect
(a_io:
SOCKET_INPUT_OUTPUT_STREAM
)
effective procedure
{}
top
Handle a connection to the
Current
.
This feature is called back by the
server_job
when a connection attempted (see the
when_connect
feature of
SOCKET_SERVER
)
handle_shutdown
(a_server_job:
SOCKET_SERVER_JOB
)
effective procedure
{}
top
Shutdown gracefully when all connections are closed.
This feature is called back by the
server_job
(or
a_server_job
) when it is asked to shut down (see the
when_shutdown
feature of
SOCKET_SERVER
)
require
a_server_job =
server_job
server_job
.will_shutdown
standalone_shutdown
(a_server: SERVER [C_ ->
CONNECTION
])
effective procedure
{}
top
Force
Current
to shutdown.
require
a_server = Current