Unit 14 Networking in Java: Structure
Unit 14 Networking in Java: Structure
14.1 Introduction
In the last unit, we have discussed JSP and Servlets. In this unit, we shall
discuss Networking features of Java. The Net class library, java.net,
provides a high-level interface for connections over the Internet or any other
kind of TCP/IP network. Using these interfaces makes it possible for a Java
application to connect to existing network services, provide its own network
services, and even allow for multiuser, network-aware games over the
Internet. Whereas these can be quite complicated to program in other
languages, the java.net package allows the basics of socket connection to
be set up in as little as 10 lines of code.
Objectives:
After studying this unit, you should be able to:
explain Networking in Java
describe URL objects
14.4 Summary
The java.net package contains classes that provide an easy-to-use
interface to basic network programming.
The sun.tools.debug class library adds built-in debugging support to the
Java programming language.
When sockets are used in an applet, still it is subject to the security
restrictions that prevents from connecting to any other system other than
the same one the applet came from.
There are many new subclasses of the SocketException class, to
represent network errors on a finer level of granularity than in Java 1.02.
Terminal Questions
1. ContentHandler, DatagramPacket, DatagramSocket, InetAddress.
(Refer Section 14.2.)
2. URL, URLConnection, URLEncoder, URLStreamHandler.
(Refer Section 14.3.)
3. RemoteArray, RemoteBoolean, RemoteByte, RemoteChar etc.
(Refer Section 14.3)
4. getLineNumber(), getLocalVariable(), getMethodName() etc.
(Refer Section 14.3)
5. addSystemThread(), close(), findClass(), freeMemory() etc.
(Refer Section 14.3)
––––––––––––––––––––