Network Programming with Perl / Edition 1

Network Programming with Perl / Edition 1

5.0 2
by Lincoln D. Stein
     
 

"This is a superb book. Another splendid book from Lincoln, whose mastery and lucid exposition make this a must-have for the serious Perl programmer."
--Jon Orwant, Chief Technology Officer, O'Reilly & Associates
Founder of The Perl Journal, author of Mastering Algorithms with Perl, (O'Reilly & Associates)
and co-author of

See more details below

Overview

"This is a superb book. Another splendid book from Lincoln, whose mastery and lucid exposition make this a must-have for the serious Perl programmer."
--Jon Orwant, Chief Technology Officer, O'Reilly & Associates
Founder of The Perl Journal, author of Mastering Algorithms with Perl, (O'Reilly & Associates)
and co-author of Programming Perl, Third Edition (O'Reilly & Associates)

Network Programming with Perl is a comprehensive, example-rich guide to creating network-based applications using the Perl programming language. Among its many capabilities, modern Perl provides a straightforward and powerful interface to TCP/IP, and this book shows you how to leverage these capabilities to create robust, maintainable, and efficient custom client/server applications.

The book quickly moves beyond the basics to focus on high-level, application programming concepts, tools, and techniques. Readers will find a review of basic networking concepts and Perl fundamentals, including Perl's I/O functions, process model, and object-oriented extensions. In addition, the book examines a collection of the best third-party modules in the Comprehensive Perl Archive Network, including existing network protocols for e-mail, news, and the Web.

The core of the book focuses on methods and alternatives for designing TCP-based client/server systems and more advanced techniques for specialized applications. Specific topics covered include:

  • The Berkeley Sockets API
  • The TCP protocol and the IO::Socket API
  • FTP filesharing service
  • The Net::Telnet module for adapting clients to interactive network services
  • SMTP, including how to create and send e-mails with multimedia attachments
  • POP, IMAP, and NNTP for receiving and processing e-mail
  • HTTP and the LWP module for communicating with Web servers
  • Forking servers and the UNIX and Windows inetd daemons
  • Perl's experimental multithreaded API
  • Multiplexed operations and nonblocking I/O
  • Bulletproofing servers
  • TCP urgent data
  • UDP protocol and servers
  • Broadcasting and multicasting
  • Interprocess communication with UNIX-domain sockets

Useful, working programs demonstrate ideas and techniques in action, including a real-time chat and messaging system, a program for processing e-mail containing MIME attachments, a program for mirroring an FTP site, and a Web robot.

Network Programming with Perl focuses on TCP/IP rather than just the common Web protocols. Modeled after the critically acclaimed TCP/IP Illustrated by W. Richard Stevens, this book achieves a level of detail far superior to most. It is an essential resource for network administrators and Perl programmers who are creating network applications.

0201615711B04062001

Read More

Product Details

ISBN-13:
9780201615715
Publisher:
Addison-Wesley
Publication date:
12/29/2000
Edition description:
New Edition
Pages:
784
Sales rank:
1,302,189
Product dimensions:
7.40(w) x 9.00(h) x 1.70(d)

Meet the Author

Lincoln Stein has an M.D. and is a scientist at Cold Spring Harbor Laboratory. When the Web first emerged, he created and maintained one of the earliest Internet sites for distribution of Human Genome Project data and has since become an acknowledged expert in Web, network, and Perl programming. Known for his exceptional ability to synthesize and present complex information, he writes for The Perl Journal and Web Techniques magazines and is the author of four other books.

0201615711AB04062001

Table of Contents

Preface.

I. BASICS.

1. Input/Output Basics.

Perl and Networking.

Networking Made Easy.

Filehandles.

Using Object-Oriented Syntax with the IO::Handle and IO::File Modules.

Summary.

2. Processes, Pipes, and Signals.

Processes.

Pipes.

Signals.

Summary.

3. Introduction to Berkeley Sockets.

Clients, Servers, and Protocols.

Berkeley Sockets.

Socket Addressing.

A Simple Network Client.

Network Names and Services.

Network Analysis Tools.

Summary.

4. The TCP Protocol.

A TCP Echo Client.

Socket Functions Related to Outgoing Connections.

A TCP Echo Server.

Adjusting Socket Options.

Other Socket-Related Functions.

Exceptional Conditions during TCP Communications.

Summary.

5. The IO::Socket API.

Using IO::Socket.

IO::Socket Methods.

More Practical Examples.

Performance and Style.

Concurrent Clients.

Summary.

II. DEVELOPING CLIENTS FOR COMMON SERVICES.

6. FTP and Telnet.

Net::FTP.

Net::Telnet.

Summary.

7. SMTP: Sending Mail.

Introduction to the Mail Modules.

Net::SMTP.

MailTools.

MIME-Tools.

Summary.

8. POP, IMAP, and NNTP: Processing Mail and Netnews.

The Post Office Protocol.

The IMAP Protocol.

Internet News Clients.

A News-to-Mail Gateway.

Summary.

9. Web Clients.

Installing LWP.

LWP Basics.

LWP Examples.

Parsing HTML and XML.

Summary.

III. DEVELOPING TCP CLIENT/SERVER SYSTEMS.

10. Forking Servers and the inetd Daemon.

Standard Techniques for Concurrency.

Running Example: A Psychotherapist Server.

The Psychotherapist as a Forking Server.

A Client Script for the Psychotherapist Server.

Daemonization on UNIX Systems.

Starting Network Servers Automatically.

Using the inetd Super Daemon.

Summary.

11. Multithreaded Applications.

About Threads.

A Multithreaded Psychiatrist Server.

A Multithreaded Client.

Summary.

12. Multiplexed Applications.

A Multiplexed Client.

The IO::Select Module.

A Multiplexed Psychiatrist Server.

Summary.

13. Nonblocking I/O.

Creating Nonblocking I/O Handles.

Using Nonblocking Handles.

Using Nonblocking Handles with Line-Oriented I/O.

A Generic Nonblocking I/O Module.

Nonblocking Connects and Accepts.

Summary.

14. Bulletproofing Servers.

Using the System Log.

Setting User Privileges.

Taint Mode.

Using chroot().

Handling HUP and Other Signals.

Summary.

15. Preforking and Prethreading.

Preforking.

Prethreading.

Performance Measures.

Summary.

16. IO::Poll.

Using IO::Poll.

IO::Poll Methods.

A Nonblocking TCP Client Using IO::Poll.

Summary.

IV. ADVANCED TOPICS.

17. TCP Urgent Data.

"Out-of-Band" Data and the Urgent Pointer.

Using TCP Urgent Data.

The sockatmark() Function.

A Travesty Server.

Summary.

18. The UDP Protocol.

A Time of Day Client.

Creating and Using UDP Sockets.

UDP Errors.

Using UDP Sockets with IO::Socket.

Sending to Multiple Hosts.

UDP Servers.

Increasing the Robustness of UDP Applications.

Summary.

19. UDP Servers.

An Internet Chat System.

The Chat Client.

The Chat Server.

Detecting Dead Clients.

Summary.

20. Broadcasting.

Unicasting versus Broadcasting.

Broadcasting Explained.

Sending and Receiving Broadcasts.

Broadcasting Without the Broadcast Address.

Enhancing the Chat Client to Support Resource Discovery.

Summary.

21. Multicasting.

Multicast Basics.

Using Multicast.

Sample Multicast Applications.

Summary.

22. UNIX-Domain Sockets.

Using UNIX-Domain Sockets.

A "Wrap" Server.

Using UNIX-Domain Sockets for Datagrams.

Summary.

Appendix A. Additional Source Code.

Net::NetmaskLite (Chapter 3).

PromptUtil.pm (Chapters 8 and 9).

IO::LineBufferedSet (Chapter 13).

IO::LineBufferedSessionData (Chapter 13).

DaemonDebug (Chapter 14).

Text::Travesty (Chapter 17).

mchat_client.pl (Chapter 21).

Appendix B. Perl Error Codes and Special Variables.

System Error Constants.

Magic Variables Affecting I/O.

Other Perl Globals.

Appendix C. Internet Reference Tables.

Assigned Port Numbers.

Registered Port Numbers.

Internet Multicast Addresses.

Appendix D. Bibliography.

Index. 0201615711T04062001

Read More

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >