• No results found

Web   Programming      Unleashed

N/A
N/A
Protected

Academic year: 2021

Share "Web   Programming      Unleashed"

Copied!
1121
0
0

Loading.... (view fulltext now)

Full text

(1)

Web

Programming Unleashed

Bob Breedlove, et al.

CONTENTS

Chapter 1 An Overview of Internet Programming

A Short History of the Internet

The TCP/IP Protocol Model The Network Layer

The Transport Layer

The Application Layer

Telnet

File Transfer Protocol (FTP)

Trivial File Transfer Protocol (TFTP)

Simple Mail Transfer Protocol (SMTP)

Network News Transfer Protocol (NNTP)

Gopher Protocol

HyperText Transfer Protocol

Multipurpose Internet Mail Extension

LAN Topologies Ethernet LANs

Token Ring Topology

Repeaters, Bridges, and Routers

Internetworking-Linking LANs Together Point-to-Point Links

(2)

SLIP and PPP

X.25 Links

Frame Relay Links

Integrated Digital Service Network (ISDN) Links

Asynchronous Transfer Mode Links

Routing in an Internetwork

IP Addresses and Domain Names What Is an IP Address?

Special IP Addresses

Resolving Names to Addresses

The Client/Server Model

Sockets and Socket APIs

Applications, Plug-Ins, and Applets

Summary

Chapter 2 WWW Design Issues

You Don't Own the Resources

The Internet-More Concept than Reality

Router Tables: The Internet "Glue"

Domain Name Service: Helping the Humans Understand

Client/Server Tools

Internet Design Considerations

You Don't Make the Rules

The Resources Can Be Unreliable

Transaction Timing Is Unpredictable

Designing Your Application

Design the Complete Application

Determine Which Components Will Be Internet-Based

Public Interface Components

Multiple End-User Platform Requirements

Timing Issues

Connectionless Protocols: E-Mail

The Internet Can Be Unreliable and Can Change Without Notice

(3)

Design an Alternative Delivery Mechanism

Detecting and Reporting Failures

Dealing with Disasters

Security

Passing Through Multiple Machines

Anyone with a Scope

E-Mail Example

Encryption

Secure Web Servers

Encrypting Sensitive Information

Encrypting or Password-Protecting Documents

Unsecure Request, Secure Response

Verifying the Correct Client

International Considerations

I Don't Think We're in Kansas Anymore

Non-English Speakers

Other Cultures

Addresses and Phone Numbers

Dates and Number Formatting

Time Zones

Summary

Chapter 3 Security and Encryption

Security

General Internet Security

Web Security

General Programming Security

Java Security

JavaScript Security

VBScript Security

CGI Security

Firewalls

Types of Firewalls

(4)

Building Your Own Firewall

Bastion Hosts

Packet Filters

Proxy Gateways

Encryption and Digital Signatures Legal Issues

Private Key Encryption

Public Key Encryption

SSL

S-HTTP

Shen

S/MIME

GSS-API

SET

Summary

Chapter 4 Developing Intranet Applications

The Purpose of Intranet Applications

You Own the Resources-Or Do You?

The Growth of Intranets

Application Scope

Capacity Planning

Leveraging Existing Resources

Security

Protecting Confidential Material

Security Versus Availability

Change Passwords Periodically

Dealing with Corporate Control Organizations Network Naming and Addressing

Router Operations

Corporate Standards

LAN Groups at the Local Level

Accessing Mainframe Data

(5)

Data Mirroring

Screen Scraping

Intranet Style Guide

Web Page Organization

Navigation

Page Organization

Page Design

Use of Graphics

Summary

Chapter 5 Java and the Internet

Java History

Java's Place in the Object-Oriented Continuum

Defining Java

Java Applet Definition

The Benefits of Java

Java Is Object-Oriented

Java Is Multithreaded

Java Is Dynamic

Java Is Compacted

Java Is Marked and Swept

Java Is Processor-Independent

Java Is Verified

Java Is a Multiplatform Environment

The Negatives of Java

Summary

Chapter 6 Java Development Environments

Java Development Environments

The Java Developer's Kit (JDK)

How To Use the Java Developer's Kit

The ..\java\bin Directory

(6)

Java Development Kit Closing Comments

Symantec Café

Installing Symantec Café

Café Desktop

Symantec Café and the Appletviewer

Symantec Café Closing Comments

The Borland Internet Products Borland Latte

Borland C++ 5.0

The Borland Internet Products Closing Comments

The Java Workshop

Java Workshop Closing Comments

Summary

Chapter 7 Introduction to Java

Classes, Methods, Inheritance, and Method Overriding-The Discussion Classes

Methods

Inheritance

Method Overriding

Classes, Methods, Inheritance, and Method Overriding-The Workshop

Method Overloading-The Discussion

Method Overloading-The Workshop

Interfaces-The Discussion

Interfaces-The Workshop

Introduction to Java Structure

Primitive Data Types

Booleans-The Discussion

Booleans-The Workshop

Integer Types

Character Literal

Float and Double

Casting

(7)

Casting Between Objects

Operators

Arithmetic Operators

Assignment Operators

Comparison, Logical, Incremental, and Decremental Operators

Bitwise Operators

Ternary Operator

Operator Precedence

Control Flow

The if Conditional

The while Loops

The for Loop

The switch Conditional

Scope

Arrays-The Discussion

Arrays-The Workshop

Summary

Chapter 8 Java Programming

Java Applets

Java Applet Example

HTML Tags for Java Applets

appletviewer

Applets (java.applet.Applet) The Applet Life Cycle Discussion

The Applet Life Cycle Workshop

The Logo Version 1.0

Fonts, FontMetrics, and Colors

Animation

Animation in the PC Industry

Animation Workshop

A Summary of anilogo

Optimizing Animation

(8)

UI and Java

Command Buttons

Check Boxes

Choice

Labels

Lists

Scrollbars

Text Fields

Text Areas

Putting Components in Containers

The UI and Java Workshop, Win Version 1.0 Frames

Frames Workshop

Summary

Chapter 9 Visual J++: Tools for the Internet and the Desktop

Introduction To Visual J++

Java + COM = First Class Citizen

Microsoft's Component Object Model (COM) and ActiveX The Birth of ActiveX: An Overview of COM and OLE

OLE 1.0

OLE 2.0

ActiveX: Activating the Internet

Comparing Java and COM

Java and COM: Some Differences

Java and COM: Surprising Similarities

Advantages and Disadvantages: A Close Look at Java and ActiveX

Summary

(9)

Chapter 10 Extending Java Using ActiveX

The ActiveX Advantages High Performance

Persistence

Huge Existing Code Base

Language Independence

Distributed

The Flip Side: ActiveX's Disadvantages Platform-Dependent

Security Model

Network Performance

Browser-Dependent

What Does This Mean for the Web Developer?

ActiveX and the Intranet

ActiveX and the Internet

Combining Java and COM Using Visual J++

Summary

Chapter 11 Perl and the Internet

What Is CGI and What Can It Do?

Terminology

What Are the Benefits of Using CGI?

What Are the Negatives of Using CGI?

The Protocols

Environment Variables

Getting Information from the Server

Getting Form Data

Returning Information to the Client

(10)

Chapter 12 CGI and the Internet

Pseudo Code

The CGI Program Initialization

Determining the Request Method

Sending the Form

Receiving Information from the User

System Processing

Sending a Reply to the User

Summary

Chapter 13 Using CGI in Internet Applications

What Is Perl?

What Are the Benefits of Using Perl?

Cost and Licensing

Availability

Interpreted Language

Language Capabilities

Use C Libraries

Specialized Extensions to Perl

Socket Capability

Perl Is Relatively Easy to Learn

Perl Has Built-In Debugging Facilities

Perl Help Is Readily Available

Perl Examples Are Readily Available

What Are the Negatives of Using Perl?

Interpreted Language

GNU CopyLeft License Agreement

What Can Perl Do?

CGI Scripts

Mail Processing

Automating Web Site Maintenance

(11)

Automating File Retrieval

Is Perl for You?

Chapter 14 The Perl Language

About the Perl Chapters

Writing Perl Scripts

Executing Perl Scripts

Perl Style

Perl Data Types

Perl Variable Naming Conventions

Scalar Values

Predefined Variables

Perl Syntax

Comments-Documenting the Script

Declarations

Simple Statements

Compound Statements

Loop Control

For Loops

Foreach Loops

Blocks

Goto

Perl Operators

Terms and List Operators (Leftward)

The Arrow Operator

Autoincrement and Autodecrement

Exponentiation

Symbolic Unary Operators

Binding Operators

Perl Built-In Functions

Perl Functions By Category

Alphabetical Listing of Perl Functions

Perl Regular Expressions

(12)

Regular Expressions

Perl Subroutines

Private Variables via my()

Temporary Values via local()

Passing Symbol Table Entries (typeglobs)

Pass By Reference

Prototypes

Overriding Built-In Functions

What's Next?

Summary

Chapter 15 Perl in Internet Applications

A CGI Shell

"Hello World" Interactive

Programming the GO Application The GO Application

go.cgi: The Heart of the GO Application

GET Method

Printing Categories

Printing URLs

Handling Forms

Finalization Section

postlink.pl: The Index Posting Program Implementing PostLink

Initialization

Main Processing

The From: Line

Process the Message

Writing the Index Files

Security: Checking the From: Line

Finalization Section

Utility Programs

(13)

SetIndex: Creating Link Files

SortIndex: Sorting the Index Files

Summary

Chapter 16 Microsoft Implementation Approach

Communications Technology Background Networks

Client/Server Systems

Modems

Overview of Windows Communications Tools of the Trade

Windows Sockets (WinSock)

The Win32 Internet (WinInet) API

Microsoft's Internet Client/Server Architecture

The Internet Server API (ISAPI)

ActiveX Controls

The Messaging API (MAPI)

Internet Security Through Code Signing Addressing Security Issues

Signing Your Code

Considering the Cash Factor

Summary

Chapter 17 Using the Win32 Internet (WinInet) API

Overview

Introducing the WinInet API

Advantages of Using the WinInet API

Handles and Functions

General-Purpose Internet Functions

What Is File Transfer Protocol (FTP)?

WinInet FTP Functions

The Gopher

(14)

WinInet Gopher Functions

HyperText Transfer Protocol (HTTP)

WinInet HTTP Functions

Sample Program: RAWHTML.EXE The CRawHtmlApp Class

The CRawHtmlDlg Dialog Class Header (HTMLDLG.H)

The CRawHtmlDlg Dialog Class Implementation (HTMLDLG.CPP)

Initializing a WinInet Session

Getting a Protocol Handle

Opening the Desired File

Querying for Information

Reading the File Data

Summary

Chapter 18 JavaScript and the Internet

What Is JavaScript?

The Client-Side Features of JavaScript

Java Versus JavaScript

New Features of JavaScript in Netscape Navigator 3.0

The Server Side of JavaScript

When To Use JavaScript

The Limitations of JavaScript

Summary

Chapter 19 The JavaScript Language

Embedding JavaScript in HTML Using the <SCRIPT> Tag

Handling Events

Variables and Literals Defining Variables

Scope of Variables

Literally Literals

(15)

Expressions and Operators Assignment Operators

Arithmetic Operators

Bitwise Operators

Logical Operators

Comparison Operators

String Operators

Order of Precedence

Control Statements and Functions Conditional Statements

Loop Statements

Comments

Fundamentals of Objects

Objects and Their Properties

Defining Methods

Working with Objects

Creating New Objects

Defining Arrays

Built-In Objects and Functions The String Object

The Math Object

The Date Object

Built-In Functions

Netscape Objects

The Navigator Object Hierarchy

The Importance of HTML Layout

The Window Object

The location Object

The History Object

The document Object

The Form Object Event Handlers

The forms Array

(16)

Form Object Methods

The element Objects

The element Methods

Windows and Frames

The Window Object Properties

The Window Object Methods

Dividing the Window into Frames

Summary

Chapter 20 JavaScript in Internet Applications

A Forms Example

A Windows Example A Frames Example

Reading the Cookie File

Resources on the Web

Summary

Chapter 21 VBScript and the Internet

What Is VBScript?

What Can VBScript Do?

Learning VBScript

Security and VBScript

VBScript Versus Visual Basic and Visual Basic for Applications

How VBScript Enhances Browsers and HTML

Host Environments Web Browsers

Other Internet Tools

Placing VBScript Code Within an HTML Document

Summary

(17)

Chapter 22 The VBScript Language

All About Variables Creating Variables

The Contents of Variables

How Variables Are Stored

Constants

The Scope and Lifetime of a Variable

Arrays

Using Operators

Arithmetic Operators

Comparison Operators

Logical Operators

String Concatenation

Operator Precedence

Intrinsic Functions Dates and Times

Advanced Math

The MsgBox Function

Input Boxes

Controlling the Flow of Code

Using Control Structures To Make Decisions

The Select Case Structure

Using Control Structures To Make Code Repeat

Building a Home for Your Code Subroutines

Functions

Passing Arguments into Procedures Event Procedures

Method Procedures

Where To Put Procedures

Intrinsic HTML Form Controls

An Introduction To HTML Forms

(18)

The Button Control The Text Control

Using Objects and ActiveX Controls

ActiveX Controls

Summary

Chapter 23 VBScript Application Pages

Metric Conversion Application

Interactive Tutorial Application

Pace-Pal Application

Information Submittal Application

The Advantage of Validating Server-Bound Data

Browser Objects

Summary

Chapter 24 CGI Scripting with the UNIX Shell

How CGI Scripts Work, a Redux

Local Time and Who's Logged In

The Environment Wrapped Up in the CGI Transmission

Pages Based on Browser Software

Checking the Host Domain

How Fast Is Your Connection?

Remote ping

A Form Front End

Another Example: finger

Another Script Trick: Redirection

Summary

Chapter 25 HyperText Markup Language (HTML)

Body and Text Commands

The Basics: What Every HTML Document Needs

(19)

Basic Paragraph Text Tags

Text Styles

Color Values

Hyperlinks

Images

HTML Interactions and Enhancements Forms

Tables

Multimedia: Audio, Video, Applications

Frames

Summary

Chapter 26 SGML

The Problem

The Solution

Standards

Portability

Form and Structure

Authoring Systems

Instance Components Elements

Minimization

Attributes

Advantages of Structured Markup

Document Type Declaration

Coming Together-The SGML Authoring System

The Future of SGML

Chapter 27 Netscape Extensions

Trouble in Paradise

Structuring Netscape HTML

The <HEAD> Element

(20)

The <BODY> Element

Formatting, Paragraphing, and Other Wonders

Text Gone Haywire

You've Been Enlisted

Rulers of the Web

Images and Imagination

Image Sizing

Border Patrol and Lebensraum

Image Mapping Made Easy

Tables and Their Possibilities

You've Been Framed

Aiming for a Window

JavaScript and Java

Miscellaneous

Summary

Chapter 28 Microsoft Internet Explorer-Only HTML Tags

The <BODY> of the Page

<BODY BACKGROUND= BGPROPERTIES=>

<BODY BGSOUND SRC=>

Paragraph and Text Style Tags

<STYLE> : </STYLE>

Using <STYLE> Attributes for an Entire Document

Using an External <STYLE> Sheet

Color Values

Tables

<TABLE>

<TD>

Multimedia: Audio, Video, Applications

<BGSOUND>

<MARQUEE> : </MARQUEE>

(21)

Frames and Floating Frames

<FRAMESET>

Floating Frames

Summary

Chapter 29 Shockwave and Lingo

What Is Shockwave?

System Requirements Shockwave

Shockwave for Director (4.0x and 5)

Afterburner

Adding a Shocked Movie to an HTML Document

Broken Icons JavaScript

Multiple Movies

Multiple Movies Utilizing Sound

Looping

Asynchronous Operations Functions

Other Lingo Extensions

Director Commands Disabled for Shockwave XObjects, XCMDs, XFCNs

Disabled Director 5 Commands

Work Arounds for Other Director-Disabled Features

Director Bandwidth Issues

Shockwave for Authorware Afterburner

Using Afterburner for Authorware

Editing Map Files

The Elements of a Map File

Editing Map Files in Windows

Editing a Map File on a Mac

Allowing Windows and Macs to Share External Files

(22)

Speeding Up Mac and Cross-Platform Files Using Transition Xtras

Combining Windows and Mac Map Files

Referencing Files in Multiple Locations

Authorware Bandwidth Issues

New Shockwave-Specific Functions and Variables Existing Authorware Functions

System Security

Invoking Security

The Security Dialog Box

Integrating Authorware into Browsers

Displaying an Alternate Image on Noncompatible Browsers

Shockwave for Freehand

Obtaining Shockwave and URL Managers

Embedding a Freehand Graphic on an HTML Page

The EMBED Tag

TOOLBAR

Activating a Link in Netscape

The URL Xtra Adding a URL

Attaching the URL to an Object

Editing, Copying, and Deleting URLs

Finding URL Associations

Afterburner for Freehand

Opening Compressed Graphics in Freehand

Using Fonts

Features Disabled for Shockwave for Freehand

Configuring Servers UNIX

Mac

Webstar

Summary

(23)

Chapter 30 Creating an ActiveX Control To Activate a Web Page

Overview of ActiveX Controls

The OLE Controls 96 Specification

A Sample ActiveX Control: JIGGLER.OCX Creating an OLE Control Skeleton

Testing the Skeleton Control

Adding Functionality to the Skeleton Customizing the Project Resources

The Property Page Dialog Resource

The CJigglerCtrl Class

The CJigglerCtrl Class Interface (JIGGLERC.H)

Implementing the CJigglerCtrl Class

The CJigglerPropPage Class

Testing the Control in the OLE Control Test Container

Using the New Control on a Sample Web Page Creating a Simple HTML Web Page

Adding the JIGGLER Control to the Web Page

Programming the JIGGLER Control with VBScript

Summary

Chapter 31 VDOlive Technology

Finding Out How VDOlive Works

Installing a VDOlive Player

Installing a VDOlive Server

Creating Video Clips

Linking Video on WWW Pages

Watching Video Clips Over the Internet

Resources

(24)

Chapter 32 Creating Netscape Navigator Plug-Ins

Plug-In Design and Architecture How It All Fits Together

LiveConnect

Runtime Loading

Plug-In Instances and Instance Data

Windows and Events

Seamless Web Page Embedding

Data Streams

Assisted Installation

Netscape's SDK

Navigator Plug-In Design Considerations Choosing a Development Language

Navigator Version Compatibility

Planning for Bandwidth Limitations

Multiplatform Compatibility

Expanding To Java with LiveConnect

HTML EMBED Tag Attributes

Multiple MIME Types

MIME Contention

File Base Versus Streaming Plug-Ins

Streaming to the Navigator

Client Server Design

The Plug-In API

Who Is Calling Whom?

NP_Shutdown

A Quick Look at the Plug-In API Methods

Summary

(25)

Chapter 33 Pulling Web Information

What Do You Call "It?"

Evolving Capabilities

The PointCast Network (PCN) Features and More Features

Pros of PCN

Cons of PCN

Freeloader, Inc.

The Toolbar

Channels and Subscriptions

Smarter Screen Saver

A Time Saver

Content

Pros of Freeloader

Cons of Freeloader

Zippo

Is Zippo the Same as Excite or PointCast?

How To Use Zippo's Direct Read News

Pros of Zippo

Cons of Zippo

My Yahoo!

The Personals

Pros of My Yahoo!

Cons of My Yahoo!

Instant Online News (ION) for 95

Another Ticker Tape?

Personal Excite

Event Reminders

Has More Than One Person Used Your Computer?

Pros of Personal Excite

Cons of Personal Excite

Personal NewsPage Direct from Netcom

(26)

Pros of Netcom's NewsPage Direct

Cons of Netcom's NewsPage Direct

The Rest of Them

MSNBC Personal News Page

c|net: The Community Network

Infoseek Personal

Intel

ZD Net Personal View

Timecast and RealAudio Player Plus

Introducing Timecast: The RealAudio Guide

RealAudio Plus

Our Friends from Yesterday-Usenet's Beginnings

Where Are We Headed Next?

Chapter 34 International Considerations

Marketing Today

Marketing Changes

International Concerns

Defining an International Web Site

Who's Speaking What?

Your Competitive Advantages

Multilingual Web Browsers and Other Tools

The Power Players of Multilingual Helper Software

Preparing a Multilingual Document Making a Multilingual Web Page

Key Components: Translation and Promotion Web Translation Services

Beyond Web Translating: Promoting Your Site

Summary

(27)

Chapter 35 Creating a Custom, Integrated Application with Multiple Protocols

A Multi-Protocol Application

A Multi-Protocol Application on the Web

WebPOP

Entities

Protocols Used

Mail Functions

WebPOP Functioning

Getting Data from the User

Using Hidden Form Fields To Pass Arguments

Sending Results Back to the Browser

Dealing with the Protocols

Talking with the POP3 Mail Server

Sending Mail

Finding the User's Name

Installing the CGI Script

Performance

Ideas for Improvements

The Complete Listing

Summary

Chapter 36 RealAudio

How Do They Do That?

System Requirements Using Windows

Macintosh Users

RealAudio Player's Advanced New Features Automatic Install

Manually Installing the Player

Where To Find Hot Audio Content

(28)

RealAudio Encoder

The Making of a Good RealAudio Sound File Source

Volume Control

Key Audio Words To Live By

Can You Hear Me?

RealAudio Server

The Evaluation Program

The Easy Start Program

The Personal Server

Installing RealAudio Server

Cool Features

Creating a Hot RealAudio Web Site

Combine Hot Graphics with Hot Sound

Provide Decent Sound

Change, Change, and Change

Link to the RealAudio Library

Stereo Sound? No Way!

Summary: RealAudio Only?

Credits

Web Programming Unleashed

Copyright © 1996 by Sams.net Publishing

FIRST EDITION

All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein. For information, address Sams.net Publishing, 201 W. 103rd St., Indianapolis, IN 46290.

International Standard Book Number: 1-57521-117-3

(29)

HTML conversion by :

M/s. LeafWriters (India) Pvt. Ltd.

Website : http://leaf.stpn.soft.net e-mail : [email protected]

President, Sams Publishing: Richard K. Swadley Publishing Team Leader: Greg Wiegand Managing Editor: Cindy Morrow Director of Marketing: John Pierce Assistant Marketing

Managers:

Kristina Perry, Rachel Wolfe

Acquisitions Editor Sharon Cox Development Editor

Anthony Amico

Software Development Specialist

Brad Myers Production Editors Tonya Simpson, Ryan Rader

Copy Editors Miriam Bishop, Robin Drake, Kris Simmons, Robert Temple, June Waldman

Indexers Johnna VanHoose, Christine Nelsen,

Benjamin Slen Technical

Reviewers

Angela Allen, Kyle Amon, Sue

Charlesworth, Raj Mangal, Jay Myers, Dennis Teague

Editorial Coordinator

Bill Whitmer

Technical Edit Coordinator

Lynette Quinn Resource Coordinator

Deborah Frisby

Editorial Assistants Carol Ackerman, Andi Richter,

Rhonda Tinch-Mize

Cover Designer Tim Amrhein

Book Designer Gary Adair Copy Writer Peter Fuller Production Team

Supervisor

Brad Chinn Production Betsy Deeter,

Jennifer

Dierdorff, Mike

Henry, Brad

Lenser, Janet

Seib, Ian Smith

(30)

About the Authors

Robert F. Breedlove

Robert Breedlove is a senior systems engineer with EDS. He has over 20 years of experience in data processing, including extensive client/server, UNIX, intranet, and Internet experience. He can be reached at

[email protected]

or at his home page

http://www.channel1.com/users/rbreed01/

William F. (Bill) Anderson

Upon graduation from the University of Idaho in 1968, Bill Anderson joined the U.S. Air Force as a communications officer and worked on several computer networking projects including AUTODIN.

After leaving the service, he worked on several online banking systems and online railroad systems. In 1979, he started working with UNIX and in 1983, he joined Destek to write its Ethernet driver. This marked the beginning of a career in TCP/IP networking and the Internet, including a stint as the

Technical Manager for NetMedia in Israel. In 1995, Bill Anderson returned to the United States and now teaches courses on networking, client/server, HTML, Java, network security, and system administration.

He is the author of Source File Management with SCCS (Prentice Hall, 1992) and Building UNIX System V Software (Prentice Hall, 1994).

Billy Barron

Billy Barron just started a new job as a Senior Software Engineer programming mostly in Java at the Bruton Center for the University of Texas at Dallas. Previously, he worked for almost 10 years as a systems/Internet adminstrator and has an MS in Computer Science from the University of North Texas.

He has co-authored and tech edited numerous books, including Netscape 3 Unleashed, Creating Web Applets with Java, and Tricks of the Java Programming Gurus. You can reach Billy at

[email protected]

or

(31)

http://www.utdallas.edu/~billy

Mark Bishop

Mark Bishop writes from Southern California and specializes in setting up new companies on the Internet. He's the author of The Internet Times, a weekly online publication, and other various Internet articles. He can be reached at

[email protected]

or visit his home page at

http://home1.gte.net/showcase/index.htm

Keith Brophy

Keith Brophy has many years of experience in the design, development, and testing of software systems.

He is currently a software release coordinator for X-Rite, Incorporated, a leading worldwide provider of color and appearance quality control software and instrumentation in Grandville, Michigan. Before that, he was a lead software developer for IBM's System Integration and Federal Systems divisions in the Washington, D.C. area and worked on a wide variety of systems. His experience includes building Internet systems in the "pre-Web" era. During this time, he also was responsible for various operating systems, performance, and graphical user interface research and development projects. He has taught in various venues, including Northern Virginia Community College and as the advanced Visual Basic adjunct faculty member at Grand Rapids Community College.

Mr. Brophy, along with Mr. Koets, co-authored Visual Basic 4 Performance Tuning and Optimization (Sams 1996) and was a contributing author for Visual Basic 4.0 Unleashed (Sams 1995). He also served as technical editor on Real-World Programming with Visual Basic (Sams 1995) and the revised edition of Teach Yourself Visual Basic 4 in 21 Days (Sams 1995). He has a B.S. in computer science from the University of Michigan in Ann Arbor and an M.S. in information systems from Strayer College in Washington, D.C. Mr. Brophy is the founder of DoubleBlaze Software Consortium

(www.DoubleBlaze.com), an ActiveX Internet research and development company involved in endeavors such as research for this book.

António Miguel Ferreira

António Miguel Ferreira is one of the founders and the Web expert of Esoterica S.A., an Internet Service

Provider in Portugal. He graduated in Computer Science and Engineering in INSA Lyon, France. He has

developed financial-analysis software and currently manages several corporate Web sites for different

kinds of clients based on different hardware and software platforms. He has authored technical articles in

(32)

several magazines, and his other books include CGI Programming Unleashed (Sams.net) and Searching for Gold in The Internet. For additional information, contact him via e-mail at

[email protected]

or at his home page

http://homepage.esoterica.pt/~amcf/

Edward Hooban

Edward Hooban is a programmer with enterWorks.com, a company that provides software for intranets, including Virtual DB, NetSeer, and NetFlow. Mr. Hoooban has been involved with the electronic

publishing field for over four years. He has worked as a programmer or analyst for companies such as Ernst & Young LLP, MCI, Jet Propulsion Labs, and Thomson Technology. He loves to write business plans in his spare time.

Daniel I. Joshi

Daniel I. Joshi is the managing partner of a Microsoft Solution Provider consulting company, The Joshi Group, which provides consulting services to Fortune 500 companies in the Los Angeles, California area.

Before becoming a full-time author, his corporate consulting background included work for Fortune 500 companies. As a published technical author he is a contributor to Java Developer's Reference (ISBN:

1-57521-129-7), and the leading author of Teach Yourself Café in 21 Days (ISBN: 1-57521-157-2) both with Sams Publishing.

Timothy Koets

Timothy Koets is a software engineer at X-Rite, Incorporated, a leading worldwide provider of color and appearance quality control software and instrumentation in Grandville, Michigan. Before this, Mr. Koets was a computer systems engineer in the Systems Engineering and Integration division of Martin Marietta in the Washington, D.C., area. In addition to developing Visual Basic applications, Mr. Koets has

experience in many other areas including Visual C++, computer networking, client/server applications design, parallel processing and performance analysis. He, too, has previous experience building pre-Web systems that were Internet aware. Mr. Koets is an adjunct faculty member at Grand Rapids Community college, where he teaches advanced Visual Basic, and has prior teaching experience ranging from computer programming and engineering laboratory classes to Lotus Notes training courses.

Mr. Koets, along with Mr. Brophy, co-authored Visual Basic 4 Performance Tuning and Optimization (Sams 1996) and was a contributing author for Visual Basic 4.0 Unleashed (Sams 1995). He has a B.S.

and an M.S. in electrical engineering from Michigan Technological University in Houghton, Michigan.

Mr. Koets is the founder of Cockatiel Software, an Internet research and development company that is an

(33)

affiliate of DoubleBlaze Software Consortium (www.DoubleBlaze.com).

Bryan Morgan

Bryan Morgan is a software engineer with TASC, Inc. in Fort Walton Beach, Florida. He holds a

Bachelor's degree in electrical engineering from Clemson University and has also authored material for several other books by Sams.net, including Java Developer's Reference. Bryan and his wife, Becky, are anxiously awaiting the arrival of their first child in November, 1996.

Rob McGregor

Fascinated by computers since he can remember, Rob McGregor began exploring computer

programming in BASIC as a teenager in 1978. Since then, Rob has worked as a programmer, software consultant, and 3D computer artist, and he has written a variety of programs for Microsoft and numerous other companies. In 1992 he founded Screaming Tiki Interactive, a software development company that specializes in interactive graphics and multimedia applications for Microsoft Windows. Rob lives in Rockledge, Florida, and in his free time enjoys ray tracing, reading, writing, and playing classical and electric guitar. You can contact Rob via e-mail at

[email protected]

Zan Oliphant

Zan Oliphant is part of a rebel group of software consultants in south Florida who specialize in Internet applications and multimedia device drivers. He has 10 years of experience in writing device drivers and applications for Windows, DOS, OS/2, Macintosh, and UNIX. Zan and his fellow PC programming cronies (left over from IBM's personal computer glory days in the Boca Raton, Florida, area) are always looking for interesting opportunities. Contact Zan at [email protected] if you have a cool project for them.

Stig Erik Sando

Stig Erik Sando studies Algorithm Analysis and Software Development at the University of Bergen, Norway. He is currently working on a multi-platform research tool for art history and a full software development system, both fully available on the Web. He spends much of his spare time experimenting with the Web, and the result is a full-fledged virtual fantasy Web site run by a large number of

experimental programs to provide a truly exceptional experience. You can contact Stig at

<[email protected]>

Dave Taylor

(34)

Dave Taylor is president of the interface design firm Intuitive Systems

(http://www.intuitive.com) and has been exploring UNIX and the Internet for 16 years. His online electronic mailbox is

[email protected]

Rick Tracewell

Rick Tracewell, author of A Web Author's Handbook (Peachpit Press), is a columnist ("Real World Internet") and a contributor to magazines such as MacWEEK. He owns and operates TNT Media, an Internet and Intranet design and marketing firm. He has over 10 years experience as a

marketing/advertising consultant and has been designing and marketing World Wide Web pages since early 1994. Rick, his wife Donna, and their two children, Kelsey and Nico, live in beautiful Scotts Valley, California.

Richard Wainess

Richard Wainess is a multimedia consultant and owner of Digital Visionaries, a new media company specializing in Web site design, multimedia, video production, and 3D animation. With almost two decades of experience in the evolving media arena, his clients have included corporations in air transportation, insurance, medicine, entertainment, and aerospace. He has written and produced

instructional video media, training pamphlets, and numerous articles on media design. As an Authorized Macromedia Developer, he currently teaches multimedia authoring at InfoDirect (an authorized

Macromedia Training Center). Richard holds a Bachelor of Arts degree in Media Management from the Radio-Television-Film department at California State University, Northridge.

Tell Us What You Think!

As a reader, you are the most important critic and commentator of our books. We value your opinion and want to know what we're doing right, what we could do better, what areas you'd like to see us publish in, and any other words of wisdom you're willing to pass our way. You can help us make strong books that meet your needs and give you the computer guidance you require.

Do you have access to CompuServe or the World Wide Web? Then check out our CompuServe forum by typing GO SAMS at any prompt. If you prefer the World Wide Web, check out our site at

http://www.mcp.com.

NOTE

If you have a technical question about this book, call the technical support line at (800) 571-5840, ext. 3668.

As the team leader of the group that created this book, I welcome your comments. You can fax, e-mail,

or write me directly to let me know what you did or didn't like about this book-as well as what we can do

(35)

to make our books stronger. Here's the information:

FAX: 317/581-4669

E-mail: [email protected]

Mail:

Greg Wiegand

Comments Department Sams Publishing

201 W. 103rd Street

Indianapolis, IN 46290

(36)

Chapter 1

An Overview of Internet Programming

by Bill Anderson

CONTENTS

A Short History of the Internet

The TCP/IP Protocol Model The Network Layer

The Transport Layer

The Application Layer

Telnet

File Transfer Protocol (FTP)

Trivial File Transfer Protocol (TFTP)

Simple Mail Transfer Protocol (SMTP)

Network News Transfer Protocol (NNTP)

Gopher Protocol

HyperText Transfer Protocol

Multipurpose Internet Mail Extension

LAN Topologies Ethernet LANs

Token Ring Topology

Repeaters, Bridges, and Routers

Internetworking-Linking LANs Together Point-to-Point Links

SLIP and PPP

X.25 Links

Frame Relay Links

Integrated Digital Service Network (ISDN) Links

Asynchronous Transfer Mode Links

Routing in an Internetwork

References

Related documents