You are previewing Linux® Socket Programming.
O'Reilly logo
Linux® Socket Programming

Book Description

This book teaches readers how to program Linux sockets, and gives them everything they need to know to make programs communicate effetively over networks.

It presents a comprehensive discussion of all relevant topics including: writing programs compatible with both Internet Protocol version 4 (IPv4) and IPv6, raw sockets, User Datagram Protocol (UDP), broadcasting /multicasting, server internals, and more, plus a section covering Posix threads.

It provides thorough coverage of programming with the TCP, UDP, and IP protocols, as well as lower-level raw sockets. The myriad of function calls, data structures, and options associated with the APIs are explained with well-chosen diagrams and tables.

  • After reading this book, the reader will be able to:

  • Differentiate basic datagrams vs. streaming sockets.

  • Differentiate unicast, broadcast, and multicast sockets.

  • Write socket-based network programs.

  • Write portable code for various OS'.

  • Implement client-server and peer communications

  • Increase network throughput using "connectionless" communications

  • Manage asynchronous I/O, I/O and multiple sockets.

  • Use signals, threading and processes to manage socket connections.

  • Understand new socket technologies like Mbone and 6bone.

  • Understand Remote Procedure Calls and how to implement them.

  • Understand the different socket addressing types.

  • Table of Contents

    1. Copyright
      1. Dedication
    2. About the Author
    3. Acknowledgments
    4. Tell Us What You Think!
    5. Introduction
      1. Expanding the Programming Challenge
      2. Book Organization
      3. Professional Reader's Styles
      4. Audience and Expected Interaction
      5. Disclaimers and Limits
      6. Conventions Used in This Book
    6. I. Network Programming from the Client Perspective
      1. 1. Introducing the Cookbook Network Client
        1. Connecting the World with Sockets
        2. Talking the Talk: TCP/IP Addressing Overview
        3. Hearing the Server: The Client's Basic Algorithm
          1. The Socket System Call: Procedures and Caveats
          2. Making the Call: Connecting to the Server
          3. Getting the Server's Reply
          4. Closing the Connection
        4. Summary: What's Going On Behind the Scenes?
      2. 2. TCP/IP Network Language Fluency
        1. An IP Numbering Overview
          1. Computer Identification
          2. Internet ID Organization
          3. Subnetwork Masks
          4. Routers and Address Resolution
          5. Special and Dwindling Addresses
        2. IP Host Port Numbers
        3. Network Byte Ordering
          1. Using Internet Conversion Tools
          2. Applying the Tools and Extending the Client
        4. Different Kinds of sockaddr
        5. UNIX Named Pipes
        6. Summary: Applying IP Numbering and Tools
      3. 3. Different Types of Internet Packets
        1. The Fundamental Network Packet
          1. version Field
          2. header_len Field
          3. serve_type Field
          4. ID Field
          5. dont_frag, more_frags, frag_offset Flags and Field
          6. time_to_live (TTL) Field
          7. protocol Field
          8. options Field
          9. data Field
        2. Dissecting the Various Packets
          1. Considering the Packet's Issues
            1. Protocol Overhead
            2. Protocol Message Size
            3. Protocol Reliability
            4. Protocol Message Type
            5. Protocol Throughput
            6. Protocol Data Integrity
            7. Protocol Fragmentation
          2. Packet Types
            1. The Raw Packet
            2. IP Control and Error Messaging (ICMP)
            3. User Datagram Protocol (UDP)
            4. Transmission Control Protocol (TCP)
              1. Dynamic Connections
              2. Data Loss
              3. Constricted Paths
            5. The TCP Header Definition
            6. Looking at the TCP Interactions
        3. How the IP Protocols Fit Together
        4. Snooping the Network with Tcpdump
        5. Writing a Custom Network Snooper
        6. Summary: Choosing the Best Packets for Sending Messages
      4. 4. Sending Messages Between Peers
        1. What Are Connection-Based Sockets?
          1. Open Channels Between Programs
          2. Reliable Communications
          3. Lower Protocol Connections
        2. Example: Connecting to the HTTP Daemon
          1. Simplified HTTP Protocol
          2. Getting an HTTP Page
        3. What Are Connectionless Sockets?
          1. Setting the Socket's Address
          2. Some Programs Just Need the Message
          3. Transaction TCP (T/TCP): A Connectionless TCP
        4. Sending a Direct Message
          1. Binding the Port to Your Socket
          2. Tossing the Message Around
          3. Catching the Message
        5. Ensuring UDP Message Arrival
          1. Strengthening UDP's Reliability
          2. Sequencing Packets
          3. Packet Redundancy
          4. Verifying Data Integrity
          5. Data Flow Glitches
        6. Juggling Tasks: A Multitasking Introduction
        7. Summary: Connected Versus Connectionless Models
      5. 5. Understanding the Network Layering Model
        1. Solving the Network Challenge
          1. Networking Hardware Issues
          2. Networking Transmission Issues
          3. Network to Operating System Interfacing
          4. Network to Program Interfacing
        2. Open Systems Interconnection (OSI) Network Model
          1. Layer 1: Physical
          2. Layer 2: Datalink
          3. Layer 3: Network
          4. Layer 4: Transport
          5. Layer 5: Session
          6. Layer 6: Presentation
          7. Layer 7: Application
        3. Internet Protocol Suite
          1. Layer 1: Network Access Layer
          2. Layer 2: Internetwork Layer (IP)
          3. Layer 2: Control/Error Messaging Extensions (ICMP)
          4. Layer 3: Host to Host (UDP)
          5. Layer 3: Host Streams (TCP)
          6. Layer 4: Application Layer
        4. Fundamental Differences Between OSI and IP
        5. What Services What?
        6. Summary: From Theory to Application
    7. II. The Server Perspective and Load Control
      1. 6. A Server Primer
        1. Mapping the Socket: The Server's General Program Flow
        2. A Simple Echo Server
          1. Binding Ports to the Socket
          2. Creating a Socket Listening Queue
          3. Accepting Client Connections
          4. Communicating with the Client
        3. General Rules About Defining Protocols
          1. Which Program Talks First?
          2. Which Program Drives the Conversation?
          3. What Level of Certification Do You Need?
          4. What Type of Data Do You Use?
          5. How Do You Handle Binary Data?
          6. How Do You Know when There Is a Deadlock?
          7. Do You Need Clock Synchronization?
          8. How and When Do You Restart the Connection?
          9. When Are You Finished?
        4. An Extended Example: An HTTP Directory Server
        5. Summary: The Server's Basic Elements
      2. 7. Dividing the Load: Multitasking
        1. Defining Multitasking: Processes Versus Threads
          1. When to Use Multitasking
          2. Multitasking Characteristics
          3. Task Differences
          4. How Do I Create a Process?
          5. How Do I Create a Thread?
          6. The __clone() System Call: The Call for the Brave
          7. Task Communication
            1. Initialization: Setting the Child's State
            2. Shared/Common Memory
            3. Interprocess Communication (IPC)
            4. Signaling a Course Change: Folding
            5. Child's Results
        2. Beating the Clock: Race Conditions and Mutexs
          1. Race Conditions
          2. Mutual Exclusion (Mutex)
          3. Pthread Mutex Problems
          4. Deadlock Prevention
        3. Controlling Children and Killing Zombies
          1. Give the Child More Attention: Priority and Scheduling
          2. Burying the Zombies: Cleaning Up after Termination
        4. Extending Current Clients and Servers
        5. Calling External Programs with the exec Server
        6. Summary: Distributing the Process Load
      3. 8. Choosing when to Wait for I/O
        1. I/O Blocking: Why?
        2. When Do I Block?
        3. Alternatives to I/O Blocking
        4. Comparing the Different I/O Programming Interactions
        5. Polling I/O
          1. A Polling Reader
          2. Polling Writer
          3. Polling Connections
        6. Asynchronous I/O
          1. On-Demand Reading
          2. Asynchronous Writes
          3. On-Demand Connections
        7. Solving Unwanted I/O Blocking with poll() and select()
        8. Implementing Timeouts
        9. Summary: Choosing the I/O Techniques
      4. 9. Breaking Performance Barriers
        1. Creating the Servlets Before the Client Arrives
          1. Placing a Cap on the Number of Client Connections
          2. Preforking Your Servers
          3. Adapting to Different Load Levels
        2. Extending Control with a Smart Select
          1. The Scheduler Storm
          2. Overburdened select()
          3. Compromising with a Smart Select
          4. Implementation Problems
          5. Redistributing the Load
        3. Delving Deeper into Socket Control
          1. General Options
          2. IP-Specific Socket Options
          3. IPv6-Specific Socket Options
          4. TCP-Specific Socket Options
        4. Recovering the Socket Descriptor
        5. Sending Before Received: Message Interleave
        6. Noting File I/O Problems
        7. Using Demand-Based I/O to Recover CPU Time
          1. Speeding Up a send()
          2. Offloading the recv()
        8. Sending High-Priority Messages
        9. Summary: Pulling Together Performance Features
      5. 10. Designing Robust Linux Sockets
        1. Using Conversion Tools
        2. Eyeing Return Values
        3. Capturing Signals
          1. SIGPIPE
          2. SIGURG
          3. SIGCHLD
          4. SIGHUP
          5. SIGIO
          6. SIGALRM
        4. Resource Management
          1. File Management
          2. Memory Heap
          3. Static Data Memory
          4. CPU, Shared Memory, and Processes
        5. Critical Servers
          1. What Qualifies as a Critical Server?
          2. Communication Events and Interruptions
            1. Physical Interruptions
            2. Routing Blips
            3. Server/Client Dropout
          3. Session Recovery Issues
          4. Session Recovery Techniques
        6. Client/Server Concurrency Issues
          1. Network Deadlock
          2. Network Starvation
        7. Denial of Service Attacks
        8. Summary: Solid-as-a-Rock Servers
    8. III. Looking at Sockets Objectively
      1. 11. Saving Time with Objects
        1. The Software Engineering Evolution
          1. Step-by-Step Functional Programming
          2. Hiding Implementation with Modular Programming
          3. Not Needing the Details: Abstract Programming
          4. Getting Close to Nature Through Object Programming
        2. Reaching Programming Nirvana
          1. Reusing Your Work
          2. Strengthening Reuse with Pluggability
        3. Laying the Object Foundation
          1. Implementation Encapsulation
          2. Behavior Inheritance
          3. Data Abstraction
          4. Method Polymorphism
        4. Object Features
          1. The Class or Object
          2. Attributes
          3. Properties
          4. Methods
          5. Access Rights
          6. Relationships
        5. Extending Objects
          1. Templates
          2. Persistence
          3. Streaming
          4. Overloading
          5. Interfaces
          6. Events and Exceptions
        6. Special Forms
          1. Record/Structure
          2. Function Bag
        7. Language Support
          1. Supporting Versus Enabled Versus Oriented
          2. How to Map Objects to Non-Object Languages
        8. Summary: Object-Oriented Thinking
      2. 12. Using Java's Networking API
        1. Exploring Different Java Sockets
          1. Programming Clients and Servers
            1. Java TCP Clients
            2. Sending/Receiving Messages
            3. Java TCP Servers
          2. Implementing Messengers
          3. Sending to Multiple Destinations
        2. Connecting Through I/O
          1. Classifying the I/O Classes
          2. Converting Between I/O Classes
        3. Configuring the Java Socket
          1. Shared Java-Socket Configurations
          2. Java Multicast-Specific Configurations
        4. Multitasking the Programs
          1. Threading a Class
          2. Adding Threads to a Class
          3. Synchronizing Methods
        5. Implementation Limitations
        6. Summary: Java-Style Network Programming
      3. 13. Designing and Using a C++ Socket Framework
        1. Why Use C++ for Sockets Programming?
          1. Simplifying Sockets Interfacing
          2. Hiding Implementation Details
          3. Deploying Reusable Components with Easy to Use Interfaces
          4. Demonstrating the Framework Design Processes
        2. Laying Out the Framework
          1. Defining the General Features
            1. Supporting the Different Types of Sockets
            2. Sending Simple Messages
            3. Managing Exceptions
            4. Configuring the Socket and Connections
          2. Grouping into Major Components
            1. Exceptions: Handling Problems
            2. Messages: Packaging and Shipping the Data
            3. Addressing: Identifying the Source and Destination
            4. Sockets: Establishing, Configuring, and Connecting
          3. Creating the Framework Hierarchy
            1. Relationships
            2. Mining Natural Inheritances
            3. Identifying Abstractions
          4. Defining Each Class's Capabilities
            1. Attributes: Adding What It Knows
            2. Methods: Adding What It Does
            3. Constructors: What Ways to Create Object
            4. Destructors: What Requires Cleanup
        3. Testing the Socket Framework
          1. The Echo Client/Server
          2. Multitasking Peer-to-Peer
        4. Implementation Limitations
          1. Sending Unknown/Undefined Messages
          2. Adding Multitasking
        5. Summary: A C++ Socket Framework Simplifies Programming
      4. 14. Limits to Objects
        1. Mind Over Objects
          1. Beginning on the Right Foot
          2. A Blender Is Not an Object
          3. Separating Analysis from Design
          4. The Right Level of Detail
          5. The Inheritance Explosion
          6. Reuse-Misuse
          7. Using C++'s friend Correctly
          8. The Overloaded Operator
        2. Objects Don't Solve Everything
          1. Fads Come and Evolve
          2. Inheritance Infection
          3. Unreachable Code
            1. Partial Class
            2. Null Functions
            3. Object Mutation
            4. Heuristic Algorithms
            5. Massively Parallel Algorithms
        3. Complexity Give and Take
          1. Simplifying Programs with Established Interfaces
          2. Multiple Inheritance Conundrum
          3. Code Bloat
        4. Project Management Dilemma
          1. Getting the Right People at the Right Time
          2. WISCY ("Whiskey") Phenomenon
          3. Testing (Dis-)Integration
            1. Shades of Gray
            2. Define "System Integration"
        5. Summary: Walk Carefully on Shale
    9. IV. Advanced Sockets—Adding Value
      1. 15. Network Encapsulation with Remote Procedure Calls (RPCs)
        1. Revisiting the OSI Model
        2. Comparing Network and Procedural Programming
          1. Language Limits
          2. Holding Connected Sessions
            1. Establishing a Dialog
            2. Checkpointing
            3. Recoverable Connections
            4. Seamless Connections
        3. Supplying Middleware Methods
          1. Stubbing Network Calls
          2. Adding the Service Call Implementation
            1. Defining Client-Side Services
            2. Answering with Server-Side Services
          3. Implementing the Presentation Layer
        4. Creating RPCs with rpcgen
          1. rpcgen's Interface Language
            1. Generating the Basic Interface
            2. Using More Complicated X Files
            3. Adding Records and Pointers to the Fray
        5. Creating Non-Stateless Calls with Open Connections
          1. Diagnosing the State Problem
          2. Remembering Where You Are
          3. Following a Specific Route
          4. Recovering from a State Failure
        6. Summary: Creating an RPC Toolset
      2. 16. Adding Security to Network Programs and SSL
        1. Giving Permission to Work
          1. Levels of Identification
          2. Forms of Interchange
        2. The Problem with the Internet
          1. Everything Is Visible
          2. Forms of Intrusion/Attack
          3. TCP/IP Crackability
        3. Securing a Network Node
          1. Restricting Access
          2. Firewalls
          3. Demilitarized Zones (DMZs)
          4. Securing the Channel
            1. Physical Espionage
            2. Message Espionage
        4. Encrypting the Messages
          1. What Are the Available Encryption Types?
          2. Published Encryption Algorithms
          3. Problems with Encryption
        5. Secure Sockets Layer (SSL)
          1. Using OpenSSL
          2. Creating an SSL Client
          3. Creating an SSL Server
        6. Summary: The Secure Server
      3. 17. Sharing Messages with Multicast, Broadcast, and Mbone
        1. Broadcasting Messages to a Domain
          1. Revisiting IP Structure
          2. Programming to Enable Broadcasting
          3. Broadcasting Limitations
        2. Multicasting Messages to a Group
          1. Joining Multicast Groups
          2. Sending a Multicast Message
          3. How the Network Provides Multicasting
          4. Getting Out the Multicast Message
            1. Letting the Routers Know
            2. Tunneling Through the Firewalls (Mbone)
          5. Multicasting Limitations
            1. Getting Hardware Support
            2. Bottlenecking Performance
            3. Accounting for Every Message
            4. Message Uniqueness
        3. Summary: Efficient Message Sharing
      4. 18. The Power of Raw Sockets
        1. When Would You Use Raw Sockets?
          1. Exposing the ICMP
          2. Controlling the IP Header
          3. Speeding Through the Physical Network
        2. What Are the Limitations?
        3. Putting Raw Sockets to Work
          1. Selecting the Right Protocol
          2. Creating an ICMP Packet
          3. Calculating a Checksum
          4. Controlling the IP Header
          5. Third-Party Traffic
        4. How Does Ping Work?
          1. The MyPing Receiver
          2. The MyPing Sender
        5. How Does Traceroute Work?
        6. Summary: Making the Raw Decisions
      5. 19. IPv6: The Next Generation to IP
        1. Current Addressing Problems
          1. Solving the Dwindling IPv4 Address Space
          2. What Does IPv6 Look Like?
          3. How Do IPv4 and IPv6 Work Together?
        2. Trying Out IPv6
          1. Configuring the Kernel
          2. Configuring the Tools
          3. Converting IPv4 Calls to IPv6
          4. Converting Raw Sockets to IPv6
          5. Converting ICMPv6 Sockets to IPv6
          6. The New Multicast Protocol
        3. IPv6 Pros and Cons
          1. Expected Linux Incorporation
        4. Summary: Moving Your Code into the Future
    10. V. Appendixes
      1. A. Data Tables
        1. Domains: First Parameter to socket()
        2. Types: Second Parameter to socket()
        3. Protocol Definitions
        4. Standard Internet Port Assignments (First 100 Ports)
        5. HTTP 1.1 Status Codes
        6. Socket Options (get/setsockopt())
        7. Signal Definitions
        8. ICMP Codes
        9. IPv4 Multicast Allocation
        10. Proposed IPv6 Address Allocation
        11. ICMPv6 Codes
        12. IPv6 Multicast Scope Field
        13. IPv6 Multicast Flags Field
      2. B. Networking API
        1. Connecting to the Network
          1. socket()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Examples
          2. bind()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          3. listen()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          4. accept()
            1. Prototype
            2. Return value
            3. Parameters
            4. Possible Errors
            5. Examples
          5. connect()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          6. socketpair()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          7. Communicating on a Channel
            1. send()
              1. Prototype
              2. Return Value
              3. Parameters
              4. Possible Errors
              5. Example
            2. sendto()
              1. Prototype
              2. Return Value
              3. Parameters
              4. Possible Errors
              5. Example
            3. sendmsg()
              1. Prototype
              2. Return Value
              3. Parameters
              4. Possible Errors
              5. Example
            4. sendfile()
              1. Prototype
              2. Return Value
              3. Parameters
              4. Possible Errors
              5. Example
            5. recv()
              1. Prototype
              2. Return Value
              3. Parameters
            6. Possible Errors
            7. Example
          8. recvfrom()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          9. recvmsg()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
        2. Terminating Connections
          1. shutdown()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
        3. Network Data Conversions
          1. htons() or htonl()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          2. ntohs() or ntohl()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          3. inet_addr()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          4. inet_aton()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          5. inet_ntoa()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          6. inet_pton()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          7. inet_ntop()
            1. Prototype
            2. Return value
            3. Parameters
            4. Possible Errors
            5. Example
        4. Network Addressing Tools
          1. getpeername()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          2. gethostname()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          3. gethostbyname()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          4. getprotobyname()
            1. Prototype
            2. Return Value
            3. Parameterspname
            4. Possible Errors
            5. Example
        5. Socket Controls
          1. setsockopt()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          2. getsockopt()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
      3. C. Kernel API Subset
        1. Tasks
          1. fork()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          2. __clone()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          3. exec()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          4. sched_yield()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          5. wait(), waitPID()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
        2. Threads
          1. pthread_create()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          2. pthread_join()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          3. pthread_exit()
            1. Prototype
            2. Return Value
            3. Parameter
            4. Possible Errors
            5. Example
          4. pthread_detach()
            1. Prototype
            2. Return Value
            3. Parameter
            4. Possible Errors
            5. Example
        3. Locking
          1. pthread_mutex_init(), pthread_mutex_destroy()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
          2. pthread_mutex_lock(), pthread_mutex_trylock()
            1. Prototype
            2. Return Value
            3. Parameter
            4. Possible Errors
            5. Example
          3. pthread_mutex_unlock()
            1. Prototype
            2. Return Value
            3. Parameter
            4. Possible Errors
            5. Example
        4. Signals
          1. signal()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Error
            5. Example
          2. sigaction()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          3. sigprocmask()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
        5. Files and So On
          1. bzero(), memset()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          2. fcntl()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible errors
            5. Example
          3. pipe()
            1. Prototype
            2. Return Value
            3. Parameter
            4. Possible Errors
            5. Example
          4. poll()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          5. read()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          6. select()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          7. write()
            1. Prototype
            2. Return Value
            3. Parameters
            4. Possible Errors
            5. Example
          8. close()
            1. Prototype
            2. Return Value
            3. Parameter
            4. Possible Error
            5. Example
      4. D. Object Classes
        1. C++ Exceptions
          1. Exception (Superclass)
          2. NetException (Class)
        2. C++ Support Classes
          1. SimpleString (Class)
          2. HostAddress (Class)
        3. C++ Messaging Classes
          1. Message (Abstract Class)
          2. TextMessage (Class)
        4. C++ Socket Classes
          1. Socket (Superclass)
          2. SocketStream (Class)
          3. SocketServer (Class)
          4. SocketClient (Class)
          5. Datagram (Class)
          6. Broadcast (Class)
          7. MessageGroup (Class)
        5. Java Exceptions
          1. java.io.IOException (Class)
          2. java.net.SocketException (Class)
        6. Java Support Classes
          1. java.net.DatagramPacket (Class)
          2. java.net.InetAddress (Class)
        7. Java I/O Classes
          1. java.io.InputStream (Abstract Class)
          2. java.io.ByteArrayInputStream (Class)
          3. java.io.ObjectInputStream (Class)
          4. java.io.OutputStream (Abstract Class)
          5. java.io.ByteArrayOutputStream (Class)
          6. java.io.ObjectOutputStream (Class)
          7. java.io.BufferedReader (Class)
          8. java.io.PrintWriter (Class)
        8. Java Socket Classes
          1. java.net.Socket (Class)
          2. java.net.ServerSocket (Class)
          3. java.net.DatagramSocket (Class)
          4. java.net.MulticastSocket (Class)