| Preface | p. xi |
| Introduction | p. 1 |
| Networks, Packets, and Protocols | p. 1 |
| About Addresses | p. 4 |
| About Names | p. 6 |
| Clients and Servers | p. 6 |
| What Is a Socket? | p. 7 |
| Exercises | p. 8 |
| Basic Sockets | p. 9 |
| Socket Addresses | p. 9 |
| TCP Sockets | p. 15 |
| TCP Client | p. 16 |
| TCP Server | p. 21 |
| Input and Output Streams | p. 25 |
| UDP Sockets | p. 26 |
| DatagramPacket | p. 27 |
| UDP Client | p. 29 |
| UDP Server | p. 34 |
| Sending and Receiving with UDP Sockets | p. 36 |
| Exercises | p. 38 |
| Sending and Receiving Data | p. 39 |
| Encoding Information | p. 40 |
| Primitive Integers | p. 40 |
| Strings and Text | p. 45 |
| Bit-Diddling: Encoding Booleans | p. 47 |
| Composing I/O Streams | p. 48 |
| Framing and Parsing | p. 49 |
| Java-Specific Encodings | p. 55 |
| Constructing and Parsing Protocol Messages | p. 55 |
| Text-Based Representation | p. 58 |
| Binary Representation | p. 61 |
| Sending and Receiving | p. 63 |
| Wrapping Up | p. 71 |
| Exercises | p. 71 |
| Beyond the Basics | p. 73 |
| Multitasking | p. 73 |
| Java Threads | p. 74 |
| Server Protocol | p. 76 |
| Thread-per-Client | p. 80 |
| Thread Pool | p. 82 |
| System-Managed Dispatching: The executor Interface | p. 84 |
| Blocking and Timeouts | p. 86 |
| accept(), read(), and receive() | p. 87 |
| Connecting and Writing | p. 87 |
| Limiting Per-Client Time | p. 87 |
| Multiple Recipients | p. 89 |
| Broadcast | p. 90 |
| Multicast | p. 90 |
| Controlling Default Behaviors | p. 95 |
| Keep-Alive | p. 96 |
| Send and Receive Buffer Size | p. 96 |
| Timeout | p. 97 |
| Address Reuse | p. 97 |
| Eliminating Buffering Delay | p. 98 |
| Urgent Data | p. 98 |
| Lingering after Close | p. 99 |
| Broadcast Permission | p. 99 |
| Traffic Class | p. 100 |
| Performance-Based Protocol Selection | p. 100 |
| Closing Connections | p. 101 |
| Applets | p. 107 |
| Wrapping Up | p. 107 |
| Exercises | p. 108 |
| Nio | p. 109 |
| Why Do We Need This? | p. 109 |
| Using Channels with Buffers | p. 112 |
| Selectors | p. 115 |
| Buffers in Detail | p. 121 |
| Buffer Indices | p. 121 |
| Buffer Creation | p. 122 |
| Storing and Retrieving Data | p. 124 |
| Preparing Buffers: clear(), flip(), and rewind() | p. 126 |
| Compacting data in a Buffer | p. 128 |
| Buffer Perspectives: duplicate(), slice(), etc. | p. 129 |
| Character Coding | p. 131 |
| Stream (TCP) Channels in Detail | p. 132 |
| Selectors in Detail | p. 135 |
| Registering Interest in Channels | p. 135 |
| Selecting and Identifying Ready Channels | p. 138 |
| Channel Attachments | p. 140 |
| Selectors in a Nutshell | p. 140 |
| Datagram (UDP) Channels | p. 141 |
| Exercises | p. 145 |
| Under the Hood | p. 147 |
| Buffering and TCP | p. 150 |
| Deadlock Danger | p. 152 |
| Performance Implications | p. 155 |
| TCP Socket Life Cycle | p. 155 |
| Connecting | p. 156 |
| Closing a TCP Connection | p. 160 |
| Demultiplexing Demystified | p. 163 |
| Exercises | p. 165 |
| Bibliography | p. 167 |
| Index | p. 169 |
| Table of Contents provided by Ingram. All Rights Reserved. |
The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.