Network Sockets

The socket command provides access to TCP/IP sockets. There are C APIs to define new channels, and there are extensions that provide UDP and other protocols. Chapter 17 describes sockets starting on page 228. Example 40-4 on page 567 uses sockets as a replacement for the Tk send command.

info hostname

The info hostname command was added to find out your host identifier.

The fconfigure Command

The best way to use sockets is with event-driven I/O. The fileevent command provides part of the solution. You also need to be able to control the blocking behavior and buffering modes of sockets. The fconfigure command lets you do this, and more. You can also control the newline translation modes and query socket-specific settings. The ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.