TCP/IP Sockets in Java (eBook)
192 Seiten
Elsevier Science (Verlag)
978-0-08-056878-2 (ISBN)
The API (application programming interface) reference sections in each chapter, which describe the relevant parts of each class, have been replaced with (i) a summary section that lists the classes and methods used in the code, and (ii) a ?gotchas? section that mentions nonobvious or poorly-documented aspects of the objects.
In addition, the book covers several new classes and capabilities introduced in the last few revisions of the Java platform. New abstractions to be covered include NetworkInterface, InterfaceAddress, Inet4/6Address, SocketAddress/InetSocketAddress, Executor, and others, extended access to low-level network information, support for IPv6, more complete access to socket options, and scalable I/O. The example code is also modified to take advantage of new language features such as annotations, enumerations, as well as generics and implicit iterators where appropriate.
Most Internet applications use sockets to implement network communication protocols. This book's focused, tutorial-based approach helps the reader master the tasks and techniques essential to virtually all client-server projects using sockets in Java. Chapter 1 provides a genral overview of networking concepts to allow readers to synchronize the concepts with terminology. Chapter 2 introduces the mechanics of simple clients and servers. Chapter 3 covers basic message construction and parsing. Chapter 4 then deals with techniques used to build more robust clients and servers. Chapter 5 (NEW) introduces the scalable interface facilities which were introduced in Java 1.5, including the buffer and channel abstractions. Chapter 6 discusses the relationship between the programming constructs and the underlying protocol implementations in more detail. Programming concepts are introduced through simple program examples accompanied by line-by-line code commentary that describes the purpose of every part of the program. The book's Web site contains many examples of command-based sockets-related code discussed throughout the book. No other resource presents so concisely or so effectively the material necessary to get up and running with Java sockets programming.
KEY FEATURES
* Focused, tutorial-based instruction in key sockets programming techniques allows reader to quickly come up to speed on Java applications.
* Concise and up-to-date coverage of the most recent platform (1.7) for Java
applications in networking technology
* Provides code for all example programs via a companion Web site to let the reader see the important objects and methods in context and to understand the purpose of each line of code.
The networking capabilities of the Java platform have been extended considerably since the first edition of the book. This new edition covers version 1.5-1.7, the most current iterations, as well as making the following improvements:The API (application programming interface) reference sections in each chapter, which describe the relevant parts of each class, have been replaced with (i) a summary section that lists the classes and methods used in the code, and (ii) a "e;gotchas"e; section that mentions nonobvious or poorly-documented aspects of the objects. In addition, the book covers several new classes and capabilities introduced in the last few revisions of the Java platform. New abstractions to be covered include NetworkInterface, InterfaceAddress, Inet4/6Address, SocketAddress/InetSocketAddress, Executor, and others; extended access to low-level network information; support for IPv6; more complete access to socket options; and scalable I/O. The example code is also modified to take advantage of new language features such as annotations, enumerations, as well as generics and implicit iterators where appropriate.Most Internet applications use sockets to implement network communication protocols. This book's focused, tutorial-based approach helps the reader master the tasks and techniques essential to virtually all client-server projects using sockets in Java. Chapter 1 provides a general overview of networking concepts to allow readers to synchronize the concepts with terminology. Chapter 2 introduces the mechanics of simple clients and servers. Chapter 3 covers basic message construction and parsing. Chapter 4 then deals with techniques used to build more robust clients and servers. Chapter 5 (NEW) introduces the scalable interface facilities which were introduced in Java 1.5, including the buffer and channel abstractions. Chapter 6 discusses the relationship between the programming constructs and the underlying protocol implementations in more detail. Programming concepts are introduced through simple program examples accompanied by line-by-line code commentary that describes the purpose of every part of the program. No other resource presents so concisely or so effectively the material necessary to get up and running with Java sockets programming. - Focused, tutorial-based instruction in key sockets programming techniques allows reader to quickly come up to speed on Java applications. - Concise and up-to-date coverage of the most recent platform (1.7) for Java applications in networking technology.
Cover 1
Table of Contents 8
Preface 12
Chapter 1. Introduction 16
1.1 Networks, Packets, and Protocols 16
1.2 About Addresses 19
1.3 About Names 21
1.4 Clients and Servers 21
1.5 What Is a Socket? 22
1.6 Exercises 23
Chapter 2. Basic Sockets 24
2.1 Socket Addresses 24
2.2 TCP Sockets 30
2.3 UDP Sockets 41
2.4 Exercises 53
Chapter 3. Sending and Receiving Data 54
3.1 Encoding Information 55
3.2 Composing I/O Streams 63
3.3 Framing and Parsing 64
3.4 Java-Specific Encodings 70
3.5 Constructing and Parsing Protocol Messages 70
3.6 Wrapping Up 86
3.7 Exercises 86
Chapter 4. Beyond the Basics 88
4.1 Multitasking 88
4.2 Blocking and Timeouts 101
4.3 Multiple Recipients 104
4.4 Controlling Default Behaviors 110
4.5 Closing Connections 116
4.6 Applets 122
4.7 Wrapping Up 122
4.8 Exercises 123
Chapter 5. NIO 124
5.1 Why Do We Need This? 124
5.2 Using Channels with Buffers 127
5.3 Selectors 130
5.4 Buffers in Detail 136
5.5 Stream (TCP) Channels in Detail 147
5.6 Selectors in Detail 150
5.7 Datagram (UDP) Channels 156
5.8 Exercises 160
Chapter 6. Under the Hood 162
6.1 Buffering and TCP 165
6.2 Deadlock Danger 167
6.3 Performance Implications 170
6.4 TCP Socket Life Cycle 170
6.5 Demultiplexing Demystified 178
6.6 Exercises 180
Bibliography 182
Index 184
Erscheint lt. Verlag | 29.8.2011 |
---|---|
Sprache | englisch |
Themenwelt | Informatik ► Grafik / Design ► Digitale Bildverarbeitung |
Informatik ► Netzwerke ► TCP / IP und IPv6 | |
Informatik ► Programmiersprachen / -werkzeuge ► Java | |
Mathematik / Informatik ► Informatik ► Web / Internet | |
ISBN-10 | 0-08-056878-5 / 0080568785 |
ISBN-13 | 978-0-08-056878-2 / 9780080568782 |
Haben Sie eine Frage zum Produkt? |
Kopierschutz: Adobe-DRM
Adobe-DRM ist ein Kopierschutz, der das eBook vor Mißbrauch schützen soll. Dabei wird das eBook bereits beim Download auf Ihre persönliche Adobe-ID autorisiert. Lesen können Sie das eBook dann nur auf den Geräten, welche ebenfalls auf Ihre Adobe-ID registriert sind.
Details zum Adobe-DRM
Dateiformat: PDF (Portable Document Format)
Mit einem festen Seitenlayout eignet sich die PDF besonders für Fachbücher mit Spalten, Tabellen und Abbildungen. Eine PDF kann auf fast allen Geräten angezeigt werden, ist aber für kleine Displays (Smartphone, eReader) nur eingeschränkt geeignet.
Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen eine
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen eine
Geräteliste und zusätzliche Hinweise
Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.
aus dem Bereich