GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
HTTP_SERVER
+
Point of view
All features
ANY
JOB
LOOP_ITEM
SERVER
RECYCLING_POOL
HTTP_SERVER
HTTP_CONNECTION
All features
class HTTP_SERVER
Summary
top
A {
SERVER
} used to manage http requests
Direct parents
Insert list:
SERVER
Overview
top
Creation features
{
ANY
}
make
(a_error_handler:
PROCEDURE
[
TUPLE 1
[
STRING
]], a_connection_factory:
FUNCTION
[
TUPLE
,
HTTP_CONNECTION
])
Initialisation of
Current
using
a_error_handler
as
error_handler
and
a_connection_factory
as
connection_factory
.
Features
Initialisation
{}
make
(a_error_handler:
PROCEDURE
[
TUPLE 1
[
STRING
]], a_connection_factory:
FUNCTION
[
TUPLE
,
HTTP_CONNECTION
])
Initialisation of
Current
using
a_error_handler
as
error_handler
and
a_connection_factory
as
connection_factory
.
Access
{
ANY
}
is_alive
:
BOOLEAN
Current
is still listening to connection
log
(a_message:
ABSTRACT_STRING
)
Write
a_message
in the
logger
Implementation
{}
current_time
:
STRING
An HTTP comatible text representation of the present date/time.
HTTP connection implementation
{
HTTP_CONNECTION
}
shutdown
A connection asked the server to shut down
halt
A connection asked the server to halt
connection_done
(a_connection:
HTTP_CONNECTION
)
A connection is about to finish.
{}
error_handler
:
PROCEDURE
[
TUPLE 1
[
STRING
]]
error handler
connection_factory
:
FUNCTION
[
TUPLE
,
HTTP_CONNECTION
]
the HTTP connection factory
handle_error
(a_message:
STRING
)
Manage an error that is explain by
a_message
connections_pool
:
RECYCLING_POOL
[
HTTP_CONNECTION
]
A pool structure used to recycle {
HTTP_CONNECTION
}
new_connection
:
HTTP_CONNECTION
An {
HTTP_CONNECTION
} freshly instanciate
release_connection
(a_connection:
HTTP_CONNECTION
)
Recycle
a_connection
.
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[HTTP_SERVER]]]):
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
Implementation
{}
logger
:
PROCEDURE
[
TUPLE 1
[
ABSTRACT_STRING
]]
Used to log message
standalone_handler_agent
:
PROCEDURE
[
TUPLE
[TUPLE 1[HTTP_SERVER]]]
An Agent to be use to launch
standalone_shutdown
common_start
(a_access:
ACCESS
):
BOOLEAN
Start
Current
using
a_access
.
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[HTTP_SERVER]]]
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: HTTP_SERVER)
Force
Current
to shutdown.
make
(a_error_handler:
PROCEDURE
[
TUPLE 1
[
STRING
]], a_connection_factory:
FUNCTION
[
TUPLE
,
HTTP_CONNECTION
])
effective procedure
{}
top
Initialisation of
Current
using
a_error_handler
as
error_handler
and
a_connection_factory
as
connection_factory
.
is_alive
:
BOOLEAN
effective function
{
ANY
}
top
Current
is still listening to connection
log
(a_message:
ABSTRACT_STRING
)
effective procedure
{
ANY
}
top
Write
a_message
in the
logger
current_time
:
STRING
effective function
{}
top
An HTTP comatible text representation of the present date/time.
shutdown
effective procedure
{
HTTP_CONNECTION
}
top
A connection asked the server to shut down
halt
effective procedure
{
HTTP_CONNECTION
}
top
A connection asked the server to halt
connection_done
(a_connection:
HTTP_CONNECTION
)
effective procedure
{
HTTP_CONNECTION
}
top
A connection is about to finish.
error_handler
:
PROCEDURE
[
TUPLE 1
[
STRING
]]
writable attribute
{}
top
error handler
connection_factory
:
FUNCTION
[
TUPLE
,
HTTP_CONNECTION
]
writable attribute
{}
top
the HTTP connection factory
handle_error
(a_message:
STRING
)
effective procedure
{}
top
Manage an error that is explain by
a_message
connections_pool
:
RECYCLING_POOL
[
HTTP_CONNECTION
]
once function
{}
top
A pool structure used to recycle {
HTTP_CONNECTION
}
new_connection
:
HTTP_CONNECTION
effective function
{}
top
An {
HTTP_CONNECTION
} freshly instanciate
release_connection
(a_connection:
HTTP_CONNECTION
)
effective procedure
{}
top
Recycle
a_connection
.
See:
connections_pool
to get the recycled connections.
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[HTTP_SERVER]]]):
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
logger
:
PROCEDURE
[
TUPLE 1
[
ABSTRACT_STRING
]]
writable attribute
{}
top
Used to log message
standalone_handler_agent
:
PROCEDURE
[
TUPLE
[TUPLE 1[HTTP_SERVER]]]
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
.
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[HTTP_SERVER]]]
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: HTTP_SERVER)
effective procedure
{}
top
Force
Current
to shutdown.
require
a_server = Current