|
1 day
50% Lecture/50% Labs
Intermediate Level
In a world of distributed computing, getting your programs to talk to each other is vital. And Tcl greatly simplifies the process of creating network-enabled applications. A single Tcl command can connect a client to a server, and you can create useful, multi-client servers in less than 50 lines of Tcl code.
In this course you will learn
All of Tcl’s mechanisms for interprocess communication including TCP/IP sockets as well as additional features such as implementing timers ant timeouts.
Recommended coding patterns for handling buffering and blocking problems
Techniques for implementing multi-client servers
This course is recommended for people with a basic Tcl programming background who need to create programs incorporating interprocess communication support.
Students should have taken the Introduction to Tcl/Tk course, or have equivalent Tcl knowledge. Although Tcl can run on a number of operating systems, the course is normally taught in a UNIX/Linux or Windows environment; student need to be familiar with basic file system use (file system navigation; creating/opening files; etc.).
This is an intensive, interactive course, which is approximately 70% lecture and 30% lab. Questions are highly encouraged. On the final day, students are given access to a zipped file containing all of the solutions to the labs and the examples used throughout the course.
A Review of the “exec” Command
Drawbacks of “exec”
Opening Interactive Pipes to Other Programs
Write Pipes
Read Pipes
Lab 1
Bi-Directional Pipes
Buffering Issues
Flushing Channels
Non-Blocking Channels
Asynchronous Communication
The Tcl Event Loop
Handling Multiple Processes
Lab 2
The Limitations of Pipes
TCP/IP Sockets in Tcl
Client Sockets
Lab 3
Server Sockets
Standard Server Socket Setup
Lab 4
Timers
Simple Sleeping
Scheduling Actions
Building Good Actions
Repeating Actions
Canceling Scheduled Actions
Lab 5
Implementing Timeouts
Lab 6
|