File 'net/smtp/data.cls' (part of 'Pool_Net')

Description (short)
Transfer message to smtp demon (DATA)
Written by
Andreas Kupries
Description
Defines the sequencer to execute a SMTP DATA transfer
Keywords
SMTP, Message transfer, DATA command

Class 'smtpDataSeq'

Depends on
Memchan
Superclasses
smtpSequencer
Options
progress
blocksize
message
string
Methods
public
DataTransferProgress (n)
DataTry ()
GotDataResponse (line)
GotTransferResponse (line)
StartTransfer ()
smtpDataSeq ()
Membervariables
public
closeChannel
nTransfered

Options

-progress
If not empty, a command to evaluate with current connection and number of bytes transfered so far as arguments.
-blocksize
Companion option to progress, optional. Defines the size of the blocks to transfer between invocations of progress. Ignored if progress is empty.
default value: 1024
-message
Either the handle of a channel containing the message to sent, or the message itself. This is determined by the contents of string.
-string
A boolean value indicating wether message is the channel containing it (false), or the message itself (true). This is optional and defaults to false.
default value: 0

Methods

DataTransferProgress (n)

Callback for transfer. Completes whole transfer or initiates next chunk. Executes the progress-handler, if it was defined.
Argument: n Number of bytes transfered by 'fcopy'.

DataTry ()

The first action taken after the construction of the sequencer completes. Writes out the command initiating a data transfer to the demon, then waits for its response.

GotDataResponse (line)

Called after smtp demon reacted on DATA. A specific response code is expected, everything else is considered as failure. Initiates the real transfer of data in case of success.
Argument: line Response of demon

GotTransferResponse (line)

After the completion of a transfer a closing response is send by the demon. It is catched here and depending on its response code the operation terminates with either success or failure.
Argument: line Response of demon.

StartTransfer ()

Starts transfer of data. If progress was specified the initiated transfer is cut into individual chunks of blocksize bytes each.

smtpDataSeq ()

Constructor.


Membervariables

closeChannel
If message contains the message itself an internal memory channel is used to allow us the placement of the transfer into the background and this flag is set to true, reminding us that we are responsible for the closing of the message channel.
initial value: 0
nTransfered
Internal counter, keeps track of the total number of bytes transfered by a single call to 'fcopy'. Used only if progress is set.
initial value: 0

Generated by AutoDoc 2.4 at 09/14/2000, invoked by Andreas Kupries