class HTTP_CONNECTION

All features

Handle one connection to the HTTP_SERVER. The real HTTP protocol is defined here.

Direct parents

conformant parents

CONNECTION, DISPOSABLE

Summary

creation features

exported features

The HTTP protocol (see RFC 2616)

Maximum:

Minimum:

Bits:

Details

make (a_method_handler_factory: FUNCTION [O_ -> TUPLE, R_][TUPLE 4 [A_, B_, C_, D_][STRINGSTRINGSTRINGOUTPUT_STREAM]HTTP_METHOD_HANDLER])
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)

require

  • a_io.is_connected

ensure

  • ios = a_io

method_handler_factory: FUNCTION [O_ -> TUPLE, R_][TUPLE 4 [A_, B_, C_, D_][STRINGSTRINGSTRINGOUTPUT_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 [O_ -> TUPLE, R_][TUPLE 4 [A_, B_, C_, D_][STRINGSTRINGSTRINGOUTPUT_STREAM]HTTP_METHOD_HANDLER])
server: HTTP_SERVER
handle_disconnect (a_io: SOCKET_INPUT_OUTPUT_STREAM)

require

  • a_io = ios
  • done

state: PROCEDURE [O_ -> TUPLE][TUPLE 1 [A_][STRING]]
states: FAST_ARRAY [E_][PROCEDURE [O_ -> TUPLE][TUPLE 1 [A_][STRING]]]
method_handler: HTTP_METHOD_HANDLER
a_request_line (line: STRING)
a_header (line: STRING)
a_body (line: STRING)
dispose

Action to be executed just before garbage collection reclaims an object.

prepare (ready: READY_DESCRIPTION)

use ready to descibe condition that make this job ready to continue.

require

  • ready /= Void
  • not ready.queryable

is_ready (ready: READY_DESCRIPTION): BOOLEAN

check if this job is ready to continue his work

require

  • ready /= Void
  • ready.queryable

done: BOOLEAN

done returns True when the job is finished. Then the job may be restart(ed) if it need to run again.

restart

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
priority: INTEGER

Never change priority after job inserted in loop_item. Priority should only be set at creation time.

< (other: JOB): BOOLEAN
Maximum_character_code: INTEGER_16

Largest supported code for CHARACTER values.

ensure

  • meaningful: Result >= 127

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

Largest supported value of type INTEGER/INTEGER_32.

Maximum_integer_32: INTEGER

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

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

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

Largest supported value of type REAL_80.

ensure

  • meaningful: Result >= Maximum_real

Minimum_character_code: INTEGER_16

Smallest supported code for CHARACTER values.

ensure

  • meaningful: Result <= 0

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

Smallest supported value of type INTEGER/INTEGER_32.

Minimum_integer_32: INTEGER

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

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

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

Smallest supported value of type REAL_80.

ensure

  • meaningful: Result <= 0.0

Boolean_bits: INTEGER

Number of bits in a value of type BOOLEAN.

ensure

  • meaningful: Result >= 1

Character_bits: INTEGER

Number of bits in a value of type CHARACTER.

ensure

  • meaningful: Result >= 1
  • large_enough: 2.to_integer ^ Result >= Maximum_character_code

Integer_bits: INTEGER

Number of bits in a value of type INTEGER.

ensure

  • integer_definition: Result = 32

Real_bits: INTEGER

Number of bits in a value of type REAL.

Pointer_bits: INTEGER

Number of bits in a value of type POINTER.

Class invariant