[ Team LiB ] Previous Section Next Section

Networking Extensions for Tcl

This chapter describes the basic programming techniques for sockets. Socket programing in Tcl is pretty easy, and a variety of extensions have been created to handle common protocols. This section reviews some of the packages that are available, and then the rest of the chapter describes how to program sockets yourself.

Scotty

graphics/common_icon.gif

The Scotty extension supports many network protocols.


The Scotty Tcl extension provides access to other network protocols like UDP, DNS, and RPC. It also supports the SNMP network management protocol and the MIB database associated with SNMP. Scotty is a great extension package that is widely used for network management applications. It is a C-level extension, so you have to compile it yourself or find a binary distribution. Its home page is:

http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/

Standard Tcl Library

The Standard Tcl Library (tcllib) has several packages that support widely used TCP-based protocols. These are all pure-Tcl implementations. There are packages for:

  • DNS client. Map between hostnames and IP addresses.

  • FTP client. Open FTP connections and download files from FTP servers.

  • FTP server. Implement a simple, extensible FTP server.

  • IRC client. Implement a chat client.

  • NNTP client. Fetch news from a news server.

  • POP3 client. Post Office Protocol lets you fetch email from mail servers.

  • POP3 server. Implement a mail server.

  • SMTP client. Send email via the SMTP protocol.

  • SMTP server. Accept incoming email via SMTP.

  • URI manipulation. Package for parsing URLs.

    There is good on-line documentation for these packages at:

    http://tcllib.sourceforge.net/tcllib/doc/

HTTP

The Tcl distribution includes an HTTP client, which is described on page 251. You don't need to add tcllib to get this. In addition, there is a nice web server built in Tcl, which is the topic of Chapter 18.

    [ Team LiB ] Previous Section Next Section