1.

Record Nr.

UNINA9910453465703321

Autore

Sarker Dr. M. O. Faruque

Titolo

Python network programming cookbook : over 70 detailed recipes to develop practical solutions for a wide range of real-world network programming tasks / / Dr. M. O. Faruque Sarker ; cover image by Gabrielay La Pintura

Pubbl/distr/stampa

Birmingham, England : , : Packt Publishing, , 2014

©2014

ISBN

1-84951-347-3

Descrizione fisica

1 online resource (234 p.)

Collana

Quick answers to common problems

Disciplina

794.81526

Soggetti

Computer games - Programming

Open source software

Python (Computer program language)

Electronic books.

Lingua di pubblicazione

Inglese

Formato

Materiale a stampa

Livello bibliografico

Monografia

Note generali

"Quick answers to common problems"--Cover.

Nota di contenuto

Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Sockets, IPv4, and Simple Client/Server Programming; Introduction; Printing your machine's name and IPv4 address; 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 socket's send/receive buffer sizes

Changing a socket to the blocking/non-blocking modeReusing socket addresses; Printing the current time from the Internet time server; Writing a SNTP client; Writing a simple echo client/server application; Chapter 2: Multiplexing Socket I/O for Better Performance; Introduction; 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



Chapter 3: IPv6, Unix Domain Sockets, and Network InterfacesIntroduction; Forwarding a local port to a remote host; Pinging hosts on the network with ICMP; Waiting for a remote network service; Enumerating interfaces on your machine; Finding the IP address for a specific interface on your machine; Finding whether an interface is up on your machine; Detecting inactive machines on your network; Performing a basic IPC using connected sockets (socketpair); Performing IPC using Unix domain sockets; Finding out if your Python supports IPv6 sockets; Extracting an IPv6 prefix from an IPv6 address

Writing an IPv6 echo client/serverChapter 4: Programming with HTTP for the Internet; Introduction; Downloading data from an HTTP server; Serving HTTP requests from your machine; Extracting cookie information after visiting a website; Submitting web forms; Sending web requests through a proxy server; Checking whether a web page exists with the HEAD request; Spoofing Mozilla Firefox in your client code; Saving bandwidth in web requests with the HTTP compression; Writing an HTTP fail-over client with resume and partial downloading; Writing a simple HTTPS server code with Python and OpenSSL

Chapter 5: E-mail protocols, FTP, and CGI programmingIntroduction; Listing the files in a remote FTP server; Uploading a local file to a remote FTP server; E-mailing your current working directory as a compressed ZIP file; Downloading your Google e-mail with POP3; Checking your remote e-mail with IMAP; Sending an e-mail with an attachment via Gmail SMTP server; Writing a guestbook for your (Python-based) web server with CGI; Chapter 6: Screen-scraping and Other Practical Applications; Introduction; Searching for business addresses using the Google Maps API

Searching for geographic coordinates using the Google Maps URL

Sommario/riassunto

An easy-to-follow guide full of hands-on examples on real-world networking tasks. It covers the advanced topics of network programming in Python using a set of selected recipes.If you are a network programmer, system/network administrator, or a web application developer, this book is ideal for you. You should have a basic familiarity with the Python programming language and TCP/IP networking concepts. However if you are a novice, you will develop an understanding of the concepts as you progress with this book. This book will serve as a supplementary material for developing hands-on skills in a