Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Learning Python Networking
  • Toc
  • feedback
Learning Python Networking

Learning Python Networking

By : Dr. M. O. Faruque Sarker, Samuel B Washington, Sam Washington
3.7 (7)
close
Learning Python Networking

Learning Python Networking

3.7 (7)
By: Dr. M. O. Faruque Sarker, Samuel B Washington, Sam Washington

Overview of this book

If you're a Python developer or a system administrator with Python experience and you're looking to take your first steps in network programming, then this book is for you. Basic knowledge of Python is assumed.
Table of Contents (12 chapters)
close
10
A. Working with Wireshark
11
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...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete