Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Python Networking

You're reading from   Learning Python Networking Utilize Python 3 to get network applications up and running quickly and easily

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781784396008
Length 320 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Network Programming and Python 2. HTTP and Working with the Web FREE CHAPTER 3. APIs in Action 4. Engaging with E-mails 5. Interacting with Remote Systems 6. IP and DNS 7. Programming with Sockets 8. Client and Server Applications 9. Applications for the Web A. Working with Wireshark Index

Taking our servers forward


There are a number of things that we can do to improve our servers. For multithreaded systems, it's common to have a mechanism for capping the number of threads in use at any one time. This can be done by keeping a count of the active threads and immediately closing any new incoming connections from clients while it's above a threshold.

For all our servers, we would also want to add a logging mechanism. I strongly recommend the standard library logging module for this, the documentation for this is complete and full of good examples. The basic tutorial is a good place to start if you've not used it before, and it can be found at https://docs.python.org/3/howto/logging.html#logging-basic-tutorial.

We also want to handle errors more comprehensively. Since the intention is that our server should be long running with minimal intervention, we want to make sure that nothing less than a critical exception causes the process to exit. We also want to make sure that errors...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime