CHAPTER 5

image

Network Data and Network Errors

The first four chapters of this book showed how hosts are named on an IP network and how to set up and tear down both TCP streams and UDP datagram connections between hosts. But how should you prepare data for transmission? How should it be encoded and formatted? And for what kinds of errors will Python programs need to be prepared?

These questions are relevant regardless of whether you are using streams or datagrams, and this chapter provides all of the basic answers to them.

Bytes and Strings

Computer memory chips and network cards both support the byte as their common currency. This tiny 8-bit package ...

Get Foundations of Python Network Programming, 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.