09.11.2016 Views

Foundations of Python Network Programming 978-1-4302-3004-5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■ CONTENTS<br />

TLS Encrypts Your Conversations ................................................................................. 92<br />

TLS Verifies Identities ................................................................................................... 93<br />

Supporting TLS in <strong>Python</strong> .............................................................................................. 94<br />

The Standard SSL Module ............................................................................................. 95<br />

Loose Ends .................................................................................................................... 98<br />

Summary ....................................................................................................................... 98<br />

■Chapter 7: Server Architecture ........................................................................... 99<br />

Daemons and Logging .................................................................................................. 99<br />

Our Example: Sir Launcelot ......................................................................................... 100<br />

An Elementary Client ................................................................................................... 102<br />

The Waiting Game ....................................................................................................... 103<br />

Running a Benchmark ................................................................................................. 106<br />

Event-Driven Servers .................................................................................................. 109<br />

Poll vs. Select .............................................................................................................. 112<br />

The Semantics <strong>of</strong> Non-blocking .................................................................................. 113<br />

Event-Driven Servers Are Blocking and Synchronous ................................................ 114<br />

Twisted <strong>Python</strong> ........................................................................................................... 114<br />

Load Balancing and Proxies ........................................................................................ 117<br />

Threading and Multi-processing ................................................................................. 117<br />

Threading and Multi-processing Frameworks ............................................................ 120<br />

Process and Thread Coordination ............................................................................... 122<br />

Running Inside inetd ................................................................................................... 123<br />

Summary ..................................................................................................................... 124<br />

■Chapter 8: Caches, Message Queues, and Map-Reduce ................................... 125<br />

Using Memcached ...................................................................................................... 126<br />

Memcached and Sharding .......................................................................................... 128<br />

Message Queues ......................................................................................................... 130<br />

viii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!