Book Details

ISBN 139781849510967

Paperback588 pages

Book Description

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

Chapter 1: Introducing Tcl

What is Tcl/Tk

Installation

Additional tools

Tcl syntax

Summary

Chapter 2: Advanced Tcl Features

Tcl features

Object-oriented programming

Accessing files

Packages in Tcl

Event-driven programming

Multithreaded applications

Summary

Chapter 3: Tcl Standalone Binaries

Understanding the executable file structure

Learning the Metakit database

Learning more about virtual file systems

Learning Tclkit

Starkit and SDX

Knowing the Starpack technology

Practical example—the Hibernator application

Advanced topics—self updating

Other solutions

Summary

Chapter 4: Troubleshooting Tcl applications

Logging

Debugging

Summary

Chapter 5: Data Storage

Internationalizations

Using SQL and databases in Tcl

Handling XML in Tcl

Storing raw Tcl values

Summary

Chapter 6: Networking in Tcl

Using TCP sockets

Using UDP sockets

Summary

Chapter 7: Using Common Internet Services

Handling e-mail

Transferring files and data

Summary

Chapter 8: Using Additional Internet Services

Checking DNS

Getting the current date and time

Using LDAP from Tcl

Communicating with Tcl applications

Summary

Chapter 9: Learning SNMP

Introduction to SNMP

Tcl and Scotty package

Using Tcl for SNMP communication

Summary

Chapter 10: Web Programming in Tcl

Tcl scripts as CGI application

Introduction to TclHttpd

Programming TclHttpd server

Summary

Chapter 11: TclHttpd in Client-Server Applications

Creating HTTP-based applications

Adding autoupdate to application

Extending your applications

Improving scalability and performance

Summary

Chapter 12: SOAP and XML-RPC

Tcl and standards for remote procedure calls

Connecting to XML-RPC services

Using SOAP protocol

Summary

Chapter 13: SSL and Security

Learning Secure Socket Layer

Authorization and roles

Securing your application

Summary

What You Will Learn

Get to know the the tools available to ease up development of Tcl code

Discover Tcl’s approach of using events over threads, which is very different from many other languages

Learn the VFS feature that allows the usage of Metakit database as normal file system

Get to know the Tcl package Scotty that handles SNMP and provides a Tk based GUI application that can be used for inspecting devices, discovering systems within our network and browsing data that can be retrieved over SNMP

Use Tcl code as legacy CGI scripts and improve it with ncgi package

Create client-server application based on HTTP protocol and Tclhttpd as embedded web server packed into Starkit technology for easy deployment

Connect to XML-RPC services and issue methods remotely, and easily integrate with major blogging engines

Learn to use encrypted connections from Tcl and the method to make sure you know whom your application is communicating with

Authors

Wojciech Kocjan

Wojciech Kocjan is a system administrator and programmer with 10 years of experience. His work experience includes several years of using Nagios for enterprise IT infrastructure monitoring. He also has experience with wide variety of devices and servers, routers, Linux, Solaris, AIX servers and i5/OS mainframes. His programming experience includes multiple languages (such as Java, Ruby, Python, and Perl) and focuses on web applications as well as client-server solutions.

Piotr Beltowski

Piotr Beltowski is an IT and software engineer, and co-author of several US patents and publications. A Master of Science in telecommunications, his technical experience includes various aspects of telecommunication, such as designing IP networks or implementing support for network protocols. Piotr's experience as Level 3 customer support lead makes him focused on finding simple solutions to complex technical issues.

His professional career includes working in international corporations such as IBM and Ericsson.

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.