1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
[comment {-*- tcl -*- doctools manpage}]
[manpage_begin transfer::transmitter n 0.3]
[keywords channel]
[keywords copy]
[keywords {data source}]
[keywords secure]
[keywords ssl]
[keywords tls]
[keywords transfer]
[keywords transmitter]
[copyright {2006-2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>}]
[moddesc {Data transfer facilities}]
[titledesc {Data source}]
[category {Transfer module}]
[require Tcl "8.5 9"]
[require snit [opt 1.0]]
[require transfer::copy [opt 0.3]]
[require transfer::data::source [opt 0.3]]
[require transfer::connect [opt 0.3]]
[require transfer::transmitter [opt 0.3]]
[description]
[para]
This package pulls data sources and connection setup together into a
combined object for the transmission of information over a socket.
These objects understand all the options from objects created
by the packages [package transfer::data::source] and
[package transfer::connect].
[section API]
[subsection {Package commands}]
[list_begin definitions]
[call [cmd transfer::transmitter] \
[arg objectName] \
[opt [arg options]...]]
This command creates a new transmitter object with an associated Tcl
command whose name is [arg objectName].
This [term object] command is explained in full detail in the sections
[sectref {Object command}] and [sectref {Object methods}]. The set of
supported [arg options] is explained in section [sectref {Options}].
[para]
The object command will be created under the current namespace if the
[arg objectName] is not fully qualified, and in the specified
namespace otherwise.
The fully qualified name of the object command is returned as the
result of the command.
[call [cmd transfer::transmitter] [method {stream channel}] \
[arg chan] [arg host] [arg port] [opt [arg arg]...]]
This method creates a fire-and-forget transfer for the data contained
in the channel [arg chan], starting at the current seek location. The
channel is configured to use binary translation and encoding for the
transfer.
The channel is automatically closed when the transfer has completed.
[para]
If both [arg host] and [arg port] are provided an [const active]
connection to the destination is made. If only a [arg port] is
specified (with [arg host] the empty string) then a [const passive]
connection is made instead.
[para]
Any arguments after the port are treated as options and are used to
configure the internal transmitter object.
See the section [sectref Options] for a list of the supported options
and their meaning.
[emph Note] however that the signature of the command prefix specified
for the [option -command] callback differs from the signature for the
same option of the transmitter object.
This callback is only given the number of bytes and transfered, and
possibly an error message. No reference to the internally used
transmitter object is made.
[para]
[vset RETURNER command]
[vset OBJECT {if it was set}]
[vset QUALIFIER {internal transmitter}]
[include include/connect_result_ref.inc]
[call [cmd transfer::transmitter] [method {stream file}] \
[arg path] [arg host] [arg port] [opt [arg arg]...]]
This method is like [method {stream channel}], except that the data
contained in the file [arg path] is transfered.
[list_end]
[subsection {Object command}]
All objects created by the [cmd ::transfer::transmitter] command have
the following general form:
[list_begin definitions]
[call [arg objectName] [method method] [opt [arg "arg arg ..."]]]
The method [method method] and its [arg arg]'uments determine the
exact behavior of the command.
See section [sectref {Object methods}] for the detailed
specifications.
[list_end]
[subsection {Object methods}]
[list_begin definitions]
[call [arg objectName] [method destroy]]
This method destroys the object. Doing so while a transmission is in
progress will cause errors later on, when the transmission completes
and tries to access the now missing data structures of the destroyed
object.
[call [arg objectName] [method start]]
This method initiates the data transmission, setting up the connection
first and then copying the information.
The method will throw an error if a transmission is already/still in
progress.
I.e. it is not possible to run two transmissions in parallel on a
single object, only in sequence. Multiple transmitter objects are
needed to manage parallel transfers, one per transmission.
Errors will also be thrown if the configuration of the data source is
invalid, or if no completion callback was specified.
[para]
[vset RETURNER method]
[vset OBJECT {for an object configured}]
[vset QUALIFIER {}]
[include include/connect_result_ref.inc]
[call [arg objectName] [method busy]]
This method returns a boolean value telling us whether a transmission
is in progress ([const True]), or not ([const False]).
[list_end]
[subsection Options]
All transmitter objects support the union of the options supported
by their connect and data source components, plus two of their own.
See also the documentation for the packages
[package transfer::data::source] and [package transfer::connect].
[list_begin options]
[opt_def -blocksize [arg int]]
This option specifies the size of the chunks to be transmitted in one
block. Usage is optional, its default value is [const 1024].
[vset MODE transmission] [include include/complete.inc]
[include include/connect_options.inc]
[include include/dsource_options.inc]
[list_end]
[vset OBJCREATE {transfer::transmitter T}]
[include include/secure.inc]
[vset CATEGORY transfer]
[include ../common-text/feedback.inc]
[manpage_end]
|