Summary
After reading this chapter you are able to establish basic network communication using the TCP or UDP protocols, using Tcl code.
In this chapter, first, TCP connectivity was presented. Starting from the most basic blocking operation mode, we moved to nonblocking network handling based on event programming. Topics including binary data transfer, error handling or buffering issues were discussed along with appropriate examples. At the end, an alternative technique of programming based on threads was presented.
Next, the way how to handle UDP communication in Tcl was presented, with TclUDP extension as the implementation. The comparison of TCP and UDP philosophy was described, with the focus on the differences between streams and datagrams. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access