home
wiki
classes/clusters list
class information
+
Point of view
LOOP_ITEM
ANY
SERVER
LOOP_ITEM
JOB
INTERNALS_HANDLER
All features
class SOCKET_SERVER_JOB
Summary
top
Encapsulate the server in a sequencer-aware job.
Direct parents
inherit list:
JOB
Overview
top
creation features
make
(a_server:
SOCKET_SERVER
)
sync_make
(a_server:
SOCKET_SERVER
)
exported features
when_connect
(handler:
PROCEDURE
[
TUPLE 1
[
SOCKET_INPUT_OUTPUT_STREAM
]])
What to do when connection happens (i.e. some client tries to connect to the server).
when_shutdown
(handler:
PROCEDURE
[
TUPLE 1
[SOCKET_SERVER_JOB]])
Should be more accurately be called
when_shutdown_or_halt
.
shutdown
Wait for the connections to finish, then stop the server.
halt
done
:
BOOLEAN
done
returns
True
when the job is finished.
The following features are inherited from
JOB
:
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
continue
Continue to do the job The work to do has to be small work and non blocking, it will continue on next call
restart
Configure the job like the initial state.
priority
:
INTEGER_32
Never change priority after job inserted in loop_item.
infix "<"
(other:
JOB
):
BOOLEAN
when_connect
(handler:
PROCEDURE
[
TUPLE 1
[
SOCKET_INPUT_OUTPUT_STREAM
]])
effective procedure
top
What to do when connection happens (i.e. some client tries to connect to the server).
The procedure is given the stream connected to the client.
require
not
done
when_shutdown
(handler:
PROCEDURE
[
TUPLE 1
[SOCKET_SERVER_JOB]])
effective procedure
top
Should be more accurately be called
when_shutdown_or_halt
.
The agent is called when a shutdown or a halt of the server occurs.
require
not
done
shutdown
effective procedure
top
Wait for the connections to finish, then stop the server.
No more connections will be accepted.
require
not
done
halt
effective procedure
top
require
not
done
done
:
BOOLEAN
writable attribute
top
done
returns
True
when the job is finished.
Then the job may be
restart
(ed) if it need to run again.
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
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
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
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