Skip to Content
Introducing Python, 2nd Edition
book

Introducing Python, 2nd Edition

by Bill Lubanovic
November 2019
Beginner
630 pages
12h 20m
English
O'Reilly Media, Inc.
Book available
Content preview from Introducing Python, 2nd Edition

Chapter 17. Data in Space: Networks

Time is nature’s way of keeping everything from happening at once. Space is what prevents everything from happening to me.

Quotes About Time

In Chapter 15, you read about concurrency: how to do more than one thing at a time. Now we’ll try to do things in more than one place: distributed computing or networking. There are many good reasons to challenge time and space:

Performance

Your goal is to keep fast components busy, not waiting for slow ones.

Robustness

There’s safety in numbers, so you want to duplicate tasks to work around hardware and software failures.

Simplicity

It’s best practice to break complex tasks into many little ones that are easier to create, understand, and fix.

Scalability

Increase your servers to handle load, decrease them to save money.

In this chapter, we work our way up from networking primitives to higher-level concepts. Let’s start with TCP/IP and sockets.

TCP/IP

The internet is based on rules about how to make connections, exchange data, terminate connections, handle timeouts, and so on. These are called protocols, and they are arranged in layers. The purpose of layers is to allow innovation and alternative ways of doing things; you can do anything you want on one layer as long as you follow the conventions in dealing with the layers above and below you.

The very lowest layer governs aspects such as electrical signals; each higher layer builds on those below. In the middle, more or less, is the IP (Internet ...

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.
Start your free trial

You might also like

Fluent Python, 2nd Edition

Fluent Python, 2nd Edition

Luciano Ramalho

Publisher Resources

ISBN: 9781492051374Errata PageSupplemental Content