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


Ulm's Oberon Library:
FTPTimerEvents


NAME

FTPTimerEvents - timeout event management for FTP sessions

SYNOPSIS

CONST setTimeoutCmd = 0;
CONST resetCmd = 1;
CONST startTransferCmd = 2;
CONST endOfTransferCmd = 3;
TYPE Event = POINTER TO EventRec;
TYPE EventRec =
      RECORD
         (Events.EventRec)
         cmd: SHORTINT; (* setTimeoutCmd .. endOfTransferCmd *)
         timeout: Times.Time;
      END;


PROCEDURE GetEventType(session: FTPSessions.Session; VAR eventType: Events.EventType);

PROCEDURE SetTimeout(session: FTPSessions.Session; period: Times.Time); PROCEDURE Reset(session: FTPSessions.Session); PROCEDURE StartTransfer(session: FTPSessions.Session); PROCEDURE EndOfTransfer(session: FTPSessions.Session);

DESCRIPTION

FTPTimerEvents provides an event type and event generating shortcuts for the timeout management of a FTP session. It does not, however, provide any event handlers. This is typically done by FTPTimers.

Notifications

SetTimeout is usually called during the initialization time of a FTP session and sets the current timeout value which is undefined by default.

Reset resets the current timer, if defined, to 0. This operation is to be called when input from the FTP client is seen to measure the time of inactivity.

Timeouts should not hit during file transfers (either downloads or uploads) as the main network connection remains inactive for longer time. StartTransfer and EndOfTransfer allow to signal such time periods to the timeout management.

Event Handling

Events are usually handled by a separate task that handles the event type returned by GetEventType for a particular session object. Following events are generated by the notification procedures:
setTimeoutCmd
set timeout value to timeout, which may be NIL to switch off timeouts.
resetCmd
reset timer to 0, if defined.
startTransferCmd
disable timer until endOfTransferCmd is encountered.
endOfTransferCmd
re-enable timer, if defined.

Event handling tasks should be aware of the termination of the session object, see Resources.

SEE ALSO

FTPSessions
FTP session objects.
FTPTimers
standardized event handler for FTPTimerEvents that terminates session objects in case of timeouts.

Edited by: borchert, last change: 2003/07/10, revision: 1.3, converted to HTML: 2003/07/10

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