Book Image

Tcl 8.5 Network Programming

Book Image

Tcl 8.5 Network Programming

Overview of this book

Tcl (Tool Command Language) is a very powerful and easy to learn dynamic programming language, suitable for a very wide range of uses. Tcl is regarded as one of the best-kept secrets in the software industry. This book gives you a hands-on experience on Tcl, helping you develop network-aware applications using this mature yet evolving language. This book shows you how to create network-aware applications with Tcl language. Packed with practical examples, the book not only takes you through the implementation of network protocols in Tcl, but also key aspects of Tcl programming. The book starts with the basic element of Tcl programming as we take a look at the syntax and fundamental commands of the language. To get us ready for network programming, we look at important Tcl features such as object-oriented programming, accessing files, packaging in TCL, event driven programming, and multithreaded applications. To create standalone single-file executable applications with Tcl we take a look at the Starpack technology, and ensure that we’ll be able to create robust applications with a thorough coverage of troubleshooting and debugging Tcl applications. The book is really about network programming, and it will not let you down with its deep coverage of these topics. Of course we look at protocols, but there are plenty of practical examples to keep things moving along. We start with the TCP and UDP protocols, and look at some other protocols to see examples of synchronizing time with other servers, querying user information and authenticating users over LDAP and performing DNS queries. The book explains Simple Network Management Protocol (SNMP), which is often used for monitoring and gathering information from various devices, such as routers, gateways, printers and many other types of equipment. We’ll also look at web programming in Tcl; processing the requests coming from the clients via the HTTP protocol and responding to these requests. You’ll be able to create a complete solution for creating a client-server application in Tcl. To round things off, you’ll see how to secure your networked applications, build public key infrastructure into your application and use Tcl’s safe interpreter feature to reduce risk of running code from unknown source.
Table of Contents (18 chapters)
Tcl 8.5 Network Programming
Credits
About the Authors
About the Reviewers
Preface
4
Troubleshooting Tcl applications

Object-oriented programming


Object-oriented programming has been a feature Tcl offered for several years with additional packages. This was possible due to the fact that Tcl syntax is easily extendable. Those packages include Incr Tcl, which is available from http://incrtcl.sourceforge.net/itcl/, XOTcl available from http://media.wu-wien.ac.at/ and Snit which can be obtained from http://www.wjduquette.com/snit/.

However, with the release of version 8.5, Tcl now comes with an object-oriented programming functionality included called TclOO. When Tcl 8.6 is out, TclOO will soon be part of core language. In Tcl 8.5 it is an extension to the language, but leverages 8.5 extensions to support it.

This is a set of additions that allows us to build a class hierarchy on its own. TclOO is designed so that it is possible to build wrappers so that it works the same as Incr Tcl, XOTcl, or Snit. So, for those of you that use any OO extension, it might be the right time to switch. For those of you that...