更新时间:2021-07-02 20:54:50
cover
Title Page
Python Network Programming Cookbook
Second Edition
Copyright
Credits
About the Author
About the Reviewers
www.PacktPub.com
Why subscribe?
Customer Feedback
Dedication
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
Sockets IPv4 and Simple Client/Server Programming
Introduction
Printing your machine's name and IPv4 address
How to do it...
How it works...
Retrieving a remote machine's IP address
Converting an IPv4 address to different formats
Finding a service name given the port and protocol
Converting integers to and from host to network byte order
Setting and getting the default socket timeout
Handling socket errors gracefully
Modifying a socket's send/receive buffer sizes
Changing a socket to the blocking/non-blocking mode
Reusing socket addresses
Printing the current time from the internet time server
Writing an SNTP client
Writing a simple TCP echo client/server application
Writing a simple UDP echo client/server application
Multiplexing Socket I/O for Better Performance
Using ForkingMixIn in your socket server applications
Using ThreadingMixIn in your socket server applications
Writing a chat server using select.select
Multiplexing a web server using select.epoll
Multiplexing an echo server using Diesel concurrent library
IPv6 Unix Domain Sockets and Network Interfaces