The first four chapters have given us a foundation: we have learned how hosts are named on an IP network, and we understand how to set up and tear down both TCP streams and UDP datagram connections between those hosts.
But what data should we then send across those lengths? How should it be encoded and formatted? For what kinds of errors will our Python programs need to be prepared?
These questions are all relevant regardless of whether we are using streams or datagrams. We will look at the basic answers in this chapter, and learn how to use sockets responsibly so that our data arrives intact.
If you were watching for it as you read the first few chapters, you may have caught me using two ...