Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
Daemons


NAME

Daemons - offer services across networks

SYNOPSIS

TYPE Daemon = POINTER TO DaemonRec;
TYPE DaemonRec = RECORD (Services.ObjectRec) END;
TYPE ServiceForChannel = PROCEDURE (daemon: Daemon; inOut: Streams.Stream);


PROCEDURE Start(daemon: Daemon; plugin: Networks.Address; serviceForChannel: ServiceForChannel): BOOLEAN; PROCEDURE Create(VAR daemon: Daemon; plugin: Networks.Address; serviceForChannel: ServiceForChannel; errors: RelatedEvents.Object): BOOLEAN;

DESCRIPTION

Daemons manages network daemons that provide services across the network using self-defined protocols. Each daemon is associated with a port other parties can connect to. On each incoming connect a dedicated task running a procedure of type ServiceForChannel is spawned that is responsible for the dialogue with the connecting party.

Start starts a daemon that runs in a newly created task and listens to port plugin. Note that daemon is to be created by the caller. Create creates and starts a daemon that runs in a newly created task and listens to port plugin.

Daemons may be shut down by terminating them (see Resources). The dialogue running procedures of type ServiceForChannel are expected to finish when their daemon object terminates. They must not call Tasks.Terminate but have to return as they are run by Jobs.

DIAGNOSTICS

Daemons has no error event types of its own. Error events generated by the underlying modules during creation time are passed to errors, otherwise to the daemon object.

SEE ALSO

Networks
general abstraction for network connections
Resources
cooperative handling of shared objects

AUTHOR

Sven Lutz, some minor revisions are due to Andreas F. Borchert
Edited by: borchert, last change: 2007/04/20, revision: 1.3, converted to HTML: 2007/04/20

Oberon || Library || Module Index || Search Engine || Definition || Module