home
wiki
classes/clusters list
class information
+
Point of view
All features
ANY
HTTP_SERVER
RECYCLING_POOL
SERVER
LOOP_ITEM
JOB
INTERNALS_HANDLER
All features
class HTTP_CONNECTION
Summary
top
Handle one connection to the
HTTP_SERVER
. The real HTTP protocol is defined here.
Direct parents
inherit list:
CONNECTION
insert list:
DISPOSABLE
,
RECYCLABLE
Class invariant
top
priority /= Minimum_integer
Overview
top
creation features
make
(a_method_handler_factory:
FUNCTION
[
TUPLE 4
[
STRING
,
STRING
,
STRING
,
OUTPUT_STREAM
],
HTTP_METHOD_HANDLER
])
features
continue
Continue to do the job The work to do has to be small work and non blocking, it will continue on next call
set_server
(a_server:
HTTP_SERVER
)
set_io
(a_io:
SOCKET_INPUT_OUTPUT_STREAM
)
method_handler_factory
:
FUNCTION
[
TUPLE 4
[
STRING
,
STRING
,
STRING
,
OUTPUT_STREAM
],
HTTP_METHOD_HANDLER
]
The first argument is the method, the second is the URI, the third is the version; the fourth is the output stream to the client socket
make
(a_method_handler_factory:
FUNCTION
[
TUPLE 4
[
STRING
,
STRING
,
STRING
,
OUTPUT_STREAM
],
HTTP_METHOD_HANDLER
])
server
:
HTTP_SERVER
handle_disconnect
(a_io:
SOCKET_INPUT_OUTPUT_STREAM
)
The HTTP protocol (see RFC 2616)
state
:
PROCEDURE
[
TUPLE 1
[
STRING
]]
states
:
FAST_ARRAY
[
PROCEDURE
[
TUPLE 1
[
STRING
]]]
method_handler
:
HTTP_METHOD_HANDLER
request_line
:
STRING
a_request_line
(line:
STRING
)
a_header
(line:
STRING
)
a_body
(line:
STRING
)
method handlers reuse
method_handlers
:
DICTIONARY
[
FAST_ARRAY
[
HTTP_METHOD_HANDLER
],
STRING
]
no_method_handlers
:
FAST_ARRAY
[
HTTP_NO_METHOD_HANDLER
]
method_handler_
(method:
STRING
, uri:
STRING
, version:
STRING
):
HTTP_METHOD_HANDLER
free_method_handler
(a_method_handler:
HTTP_METHOD_HANDLER
)
recycle
Do whatever needs to be done to free resources or recycle other objects when recycling this one
dispose
Action to be executed just before garbage collection reclaims an object.
prepare
(events:
EVENTS_SET
)
use ready to descibe condition that make this job ready to continue.
is_ready
(events:
EVENTS_SET
):
BOOLEAN
check if this job is ready to continue his work
done
:
BOOLEAN
done
returns
True
when the job is finished.
restart
Configure the job like the initial state.
ios
:
SOCKET_INPUT_OUTPUT_STREAM
priority
:
INTEGER_32
Never change priority after job inserted in loop_item.
infix "<"
(other:
JOB
):
BOOLEAN
Maximum:
Maximum_character_code
:
INTEGER_16
Largest supported code for
CHARACTER
values.
Maximum_integer_8
:
INTEGER_8
Largest supported value of type
INTEGER_8
.
Maximum_integer_16
:
INTEGER_16
Largest supported value of type
INTEGER_16
.
Maximum_integer
:
INTEGER_32
Largest supported value of type INTEGER/
INTEGER_32
.
Maximum_integer_32
:
INTEGER_32
Largest supported value of type INTEGER/
INTEGER_32
.
Maximum_integer_64
:
INTEGER_64
Largest supported value of type
INTEGER_64
.
Maximum_real_32
:
REAL_32
Largest non-special (no NaNs nor infinity) supported value of type
REAL_32
.
Maximum_real
:
REAL_64
Largest non-special (no NaNs nor infinity) supported value of type REAL.
Maximum_real_64
:
REAL_64
Largest non-special (no NaNs nor infinity) supported value of type REAL.
Maximum_real_80
:
REAL_EXTENDED
Largest supported value of type
REAL_80
.
Minimum:
Minimum_character_code
:
INTEGER_16
Smallest supported code for
CHARACTER
values.
Minimum_integer_8
:
INTEGER_8
Smallest supported value of type
INTEGER_8
.
Minimum_integer_16
:
INTEGER_16
Smallest supported value of type
INTEGER_16
.
Minimum_integer
:
INTEGER_32
Smallest supported value of type INTEGER/
INTEGER_32
.
Minimum_integer_32
:
INTEGER_32
Smallest supported value of type INTEGER/
INTEGER_32
.
Minimum_integer_64
:
INTEGER_64
Smallest supported value of type
INTEGER_64
.
Minimum_real_32
:
REAL_32
Smallest non-special (no NaNs nor infinity) supported value of type
REAL_32
.
Minimum_real
:
REAL_64
Smallest non-special (no NaNs nor infinity) supported value of type REAL.
Minimum_real_64
:
REAL_64
Smallest non-special (no NaNs nor infinity) supported value of type REAL.
Minimum_real_80
:
REAL_64
Smallest supported value of type
REAL_80
.
Bits:
Boolean_bits
:
INTEGER_32
Number of bits in a value of type
BOOLEAN
.
Character_bits
:
INTEGER_32
Number of bits in a value of type
CHARACTER
.
Integer_bits
:
INTEGER_32
Number of bits in a value of type INTEGER.
Real_bits
:
INTEGER_32
Number of bits in a value of type REAL.
Pointer_bits
:
INTEGER_32
Number of bits in a value of type
POINTER
.
continue
effective procedure
top
Continue to do the job The work to do has to be small work and non blocking, it will continue on next call
require
not done
set_server
(a_server:
HTTP_SERVER
)
effective procedure
top
set_io
(a_io:
SOCKET_INPUT_OUTPUT_STREAM
)
effective procedure
top
require
a_io.is_connected
ensure
ios = a_io
method_handler_factory
:
FUNCTION
[
TUPLE 4
[
STRING
,
STRING
,
STRING
,
OUTPUT_STREAM
],
HTTP_METHOD_HANDLER
]
writable attribute
top
The first argument is the method, the second is the URI, the third is the version; the fourth is the output stream to the client socket
make
(a_method_handler_factory:
FUNCTION
[
TUPLE 4
[
STRING
,
STRING
,
STRING
,
OUTPUT_STREAM
],
HTTP_METHOD_HANDLER
])
effective procedure
top
server
:
HTTP_SERVER
writable attribute
top
handle_disconnect
(a_io:
SOCKET_INPUT_OUTPUT_STREAM
)
effective procedure
top
require
a_io =
ios
done
state
:
PROCEDURE
[
TUPLE 1
[
STRING
]]
writable attribute
top
states
:
FAST_ARRAY
[
PROCEDURE
[
TUPLE 1
[
STRING
]]]
once function
top
method_handler
:
HTTP_METHOD_HANDLER
writable attribute
top
request_line
:
STRING
writable attribute
top
a_request_line
(line:
STRING
)
effective procedure
top
a_header
(line:
STRING
)
effective procedure
top
a_body
(line:
STRING
)
effective procedure
top
method_handlers
:
DICTIONARY
[
FAST_ARRAY
[
HTTP_METHOD_HANDLER
],
STRING
]
once function
top
no_method_handlers
:
FAST_ARRAY
[
HTTP_NO_METHOD_HANDLER
]
once function
top
method_handler_
(method:
STRING
, uri:
STRING
, version:
STRING
):
HTTP_METHOD_HANDLER
effective function
top
require
method.as_upper.is_equal(method)
ensure
Result.method.is_equal(method) or else Result
free_method_handler
(a_method_handler:
HTTP_METHOD_HANDLER
)
effective procedure
top
recycle
effective procedure
top
Do whatever needs to be done to free resources or recycle other objects when recycling this one
dispose
effective procedure
top
Action to be executed just before garbage collection reclaims an object.
prepare
(events:
EVENTS_SET
)
effective procedure
top
use ready to descibe condition that make this job ready to continue.
require
events /= Void
not events.queryable
not done
is_ready
(events:
EVENTS_SET
):
BOOLEAN
effective function
top
check if this job is ready to continue his work
require
events /= Void
events.queryable
not done
done
:
BOOLEAN
effective function
top
done
returns
True
when the job is finished.
Then the job may be
restart
(ed) if it need to run again.
restart
effective procedure
top
Configure the job like the initial state.
Example: when some window dialog appears second time, all jobs from this window are restarted.
require
done
ensure
not done
ios
:
SOCKET_INPUT_OUTPUT_STREAM
writable attribute
top
priority
:
INTEGER_32
writable attribute
top
Never change priority after job inserted in loop_item.
Priority should only be set at creation time.
infix "<"
(other:
JOB
):
BOOLEAN
effective function
top
Maximum_character_code
:
INTEGER_16
top
Largest supported code for
CHARACTER
values.
ensure
meaningful:
Result >= 127
Maximum_integer_8
:
INTEGER_8
constant attribute
top
Largest supported value of type
INTEGER_8
.
Maximum_integer_16
:
INTEGER_16
constant attribute
top
Largest supported value of type
INTEGER_16
.
Maximum_integer
:
INTEGER_32
constant attribute
top
Largest supported value of type INTEGER/
INTEGER_32
.
Maximum_integer_32
:
INTEGER_32
constant attribute
top
Largest supported value of type INTEGER/
INTEGER_32
.
Maximum_integer_64
:
INTEGER_64
constant attribute
top
Largest supported value of type
INTEGER_64
.
Maximum_real_32
:
REAL_32
constant attribute
top
Largest non-special (no NaNs nor infinity) supported value of type
REAL_32
.
Maximum_real
:
REAL_64
top
Largest non-special (no NaNs nor infinity) supported value of type REAL.
Just to give an idea of this value: 1.79769313486231570....e+308
Maximum_real_64
:
REAL_64
top
Largest non-special (no NaNs nor infinity) supported value of type REAL.
Just to give an idea of this value: 1.79769313486231570....e+308
Maximum_real_80
:
REAL_EXTENDED
top
Largest supported value of type
REAL_80
.
ensure
meaningful:
Result >=
Maximum_real
Minimum_character_code
:
INTEGER_16
top
Smallest supported code for
CHARACTER
values.
ensure
meaningful:
Result <= 0
Minimum_integer_8
:
INTEGER_8
constant attribute
top
Smallest supported value of type
INTEGER_8
.
Minimum_integer_16
:
INTEGER_16
constant attribute
top
Smallest supported value of type
INTEGER_16
.
Minimum_integer
:
INTEGER_32
constant attribute
top
Smallest supported value of type INTEGER/
INTEGER_32
.
Minimum_integer_32
:
INTEGER_32
constant attribute
top
Smallest supported value of type INTEGER/
INTEGER_32
.
Minimum_integer_64
:
INTEGER_64
constant attribute
top
Smallest supported value of type
INTEGER_64
.
Minimum_real_32
:
REAL_32
constant attribute
top
Smallest non-special (no NaNs nor infinity) supported value of type
REAL_32
.
Minimum_real
:
REAL_64
top
Smallest non-special (no NaNs nor infinity) supported value of type REAL.
Just to give an idea of this value: -1.79769313486231570....e+308
Minimum_real_64
:
REAL_64
top
Smallest non-special (no NaNs nor infinity) supported value of type REAL.
Just to give an idea of this value: -1.79769313486231570....e+308
Minimum_real_80
:
REAL_64
top
Smallest supported value of type
REAL_80
.
ensure
meaningful:
Result <= 0.0
Boolean_bits
:
INTEGER_32
top
Number of bits in a value of type
BOOLEAN
.
ensure
meaningful:
Result >= 1
Character_bits
:
INTEGER_32
top
Number of bits in a value of type
CHARACTER
.
ensure
meaningful:
Result >= 1
large_enough:
{INTEGER_32 2} ^ Result >=
Maximum_character_code
Integer_bits
:
INTEGER_32
top
Number of bits in a value of type INTEGER.
ensure
integer_definition:
Result = 32
Real_bits
:
INTEGER_32
constant attribute
top
Number of bits in a value of type REAL.
Pointer_bits
:
INTEGER_32
top
Number of bits in a value of type
POINTER
.