class HTTP_SERVER
Summary
A {SERVER} used to manage http requests
Direct parents
Insert list: SERVER
Overview
Creation features
{ANY}
Features
Initialisation
{}
Access
{ANY}
Implementation
{}
HTTP connection implementation
{HTTP_CONNECTION}
{}
Access
{ANY}
Implementation
{}
make (a_error_handler: PROCEDURE[TUPLE 1[STRING]], a_connection_factory: FUNCTION[TUPLE, HTTP_CONNECTION])
effective procedure
{}
Initialisation of Current using a_error_handler as error_handler and a_connection_factory as connection_factory.
is_alive: BOOLEAN
effective function
{ANY}
Current is still listening to connection
log (a_message: ABSTRACT_STRING)
effective procedure
{ANY}
Write a_message in the logger
current_time: STRING
effective function
{}
An HTTP comatible text representation of the present date/time.
shutdown
effective procedure
A connection asked the server to shut down
halt
effective procedure
A connection asked the server to halt
connection_done (a_connection: HTTP_CONNECTION)
effective procedure
A connection is about to finish.
error_handler: PROCEDURE[TUPLE 1[STRING]]
writable attribute
{}
error handler
connection_factory: FUNCTION[TUPLE, HTTP_CONNECTION]
writable attribute
{}
the HTTP connection factory
handle_error (a_message: STRING)
effective procedure
{}
Manage an error that is explain by a_message
connections_pool: RECYCLING_POOL[HTTP_CONNECTION]
once function
{}
A pool structure used to recycle {HTTP_CONNECTION}
new_connection: HTTP_CONNECTION
effective function
{}
An {HTTP_CONNECTION} freshly instanciate
release_connection (a_connection: HTTP_CONNECTION)
effective procedure
{}
Recycle a_connection.
See: connections_pool to get the recycled connections.
start (a_access: ACCESS)
effective procedure
{ANY}
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[HTTP_SERVER]]]): BOOLEAN
effective function
{ANY}
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
set_logger (a_logger: PROCEDURE[TUPLE 1[ABSTRACT_STRING]])
effective procedure
{ANY}
Assign logger with the value of a_logger
ensure
writable attribute
{}
Used to log message
standalone_handler_agent: PROCEDURE[TUPLE[TUPLE 1[HTTP_SERVER]]]
effective function
{}
An Agent to be use to launch standalone_shutdown
common_start (a_access: ACCESS): BOOLEAN
effective function
{}
Start Current using a_access.
stack: LOOP_STACK
writable attribute
{}
Used to loop between connections
server_job: SOCKET_SERVER_JOB
writable attribute
{}
A job use in Current
connections: INTEGER_32
writable attribute
{}
The number of {CONNECTION} in Current
shutdown_handler: PROCEDURE[TUPLE[TUPLE 1[HTTP_SERVER]]]
writable attribute
{}
Agent launched when Current is shutdowning
handle_connect (a_io: SOCKET_INPUT_OUTPUT_STREAM)
effective procedure
{}
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
{}
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
standalone_shutdown (a_server: HTTP_SERVER)
effective procedure
{}
Force Current to shutdown.
require
  • a_server = Current