Tcl Library Source Code

Bounty program for improvements to Tcl and certain Tcl packages.

[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]


transfer::receiver - Data source

Table Of Contents


package require Tcl 8.4
package require snit ?1.0?
package require transfer::data::destination ?0.2?
package require transfer::connect ?0.2?
package require transfer::receiver ?0.2?

transfer::receiver object ?options...?
transfer::receiver stream channel chan host port ?arg...?
transfer::receiver stream file path host port ?arg...?
objectName method ?arg arg ...?
objectName destroy
objectName start
objectName busy


This package pulls data destinations and connection setup together into a combined object for the reception of information coming in over a socket. These objects understand all the options from objects created by the packages transfer::data::destination and transfer::connect.


Package commands

Object command

All objects created by the ::transfer::receiver command have the following general form:

Object methods


All receiver objects support the union of the options supported by their connect and data destination components, plus one of their own. See also the documentation for the packages transfer::data::destination and transfer::connect.

Secure connections

One way to secure connections made by objects of this package is to require the package tls and then configure the option -socketcmd to force the use of command tls::socket to open the socket.

# Load and initialize tls
package require tls
tls::init -cafile /path/to/ca/cert -keyfile ...

# Create a connector with secure socket setup,
transfer::receiver R -socketcmd tls::socket ...

TLS Security Considerations

This package uses the TLS package to handle the security for https urls and other socket connections.

Policy decisions like the set of protocols to support and what ciphers to use are not the responsibility of TLS, nor of this package itself however. Such decisions are the responsibility of whichever application is using the package, and are likely influenced by the set of servers the application will talk to as well.

For example, in light of the recent POODLE attack discovered by Google many servers will disable support for the SSLv3 protocol. To handle this change the applications using TLS must be patched, and not this package, nor TLS itself. Such a patch may be as simple as generally activating tls1 support, as shown in the example below.

package require tls
tls::init -tls1 1 ;# forcibly activate support for the TLS1 protocol

... your own application code ...

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category transfer of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.


channel, copy, data destination, receiver, secure, ssl, tls, transfer


Transfer module


Copyright © 2006 Andreas Kupries