Version 0.1
A very serious, industrial web framework in Tcl
 All Data Structures Namespaces Files Functions Variables Pages
Frequently asked questions

Table of Contents

General questions

  1. Q. Why do my requests take longer than one would hope to fulfill? There's barely any load on my server, and network utilization is minimal!
    • A. This is likely due to initial connections between client and server blocking due to reverse DNS resolution. There is not much that can be done to avoid this without a very small modification to your application code within tänzer itself; any conceivable means of sidestepping this problem would involve breaking tänzer's deliberate design decision to not open nor manage its own listening sockets.

      To sidestep this problem and disable reverse DNS lookup on client sockets, put this in your application prior to entering the Tcl event loop:

set ::tcl::unsupported::noReverseDNS 1

Sockets

  1. Q. How can I listen on multiple sockets, or on a different incoming IP address?
    • A. Use [tanzer::server accept] as a callback to socket -server for each listening socket you wish to provide service on.
  2. Q. How can I use TLS with tänzer?
    • A. Use [tanzer::server accept] as a callback to the TLS equivalent of socket -server, [::tls::socket -server], as provided by the tls package, as a direct replacement for unencrypted sockets. As tänzer is focused on providing HTTP/1.1 semantics first and foremost, it is not expected that a standalone server or support module will be incorporated into tänzer itself to handle TLS service configuration and startup. On the other hand, this state of affairs offers plenty of flexibility!

Event handling

  1. Q. When can I know when I have received the full message body of an incoming request?
    • A. The session handler will pass only read events to the event handler until the message body has been read in full. The message body will be considered "finished" upon the receipt of the first write event.
  2. Q. How can I incorporate usage of tänzer in another application or framework which also uses the Tcl event loop?
    • A. Do not call [tanzer::server listen], as that method generates a call to [vwait forever]. Instead, consider accepting incoming connections using [tanzer::server accept], or create a new tanzer::session object for client sockets already opened by your framework or application.
  3. Q. Does tänzer support coroutines as event handlers?
    • A. Not explicitly. However, tänzer does not stand in the way of one delegating events to coroutines; an example of a simple coroutine-based request handler is provided in the tänzer sources in the file examples/coroutine.tcl.