0% found this document useful (0 votes)
29 views8 pages

Ch4 Network Programming & Ch6 RMI

The document discusses network programming, focusing on Java's socket programming for communication between applications on different devices. It covers key concepts such as the Socket and Server Socket classes, URL and URLConnection classes, and Remote Method Invocation (RMI) architecture. The RMI architecture includes components like stubs, skeletons, and the RMI Registry for managing remote object communication.

Uploaded by

amareguadie8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views8 pages

Ch4 Network Programming & Ch6 RMI

The document discusses network programming, focusing on Java's socket programming for communication between applications on different devices. It covers key concepts such as the Socket and Server Socket classes, URL and URLConnection classes, and Remote Method Invocation (RMI) architecture. The RMI architecture includes components like stubs, skeletons, and the RMI Registry for managing remote object communication.

Uploaded by

amareguadie8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Network Programming

1
 Refers to writing programs that execute across multiple devices

 Advantages

 Resource sharing

 Centralized software management

Java Socket programming

 Is used for communication between the applications running on different JRE

Socket class

 A socket is an end point for communication between the machines


2
 Is for clients and used to connect to server
Server Socket class

 Is a listener which waits for client to connect

Java URL

 URL: it points to a resource on the world wide web

 URL contains:- protocol

server name or IP Address

Port number

File name or directory name


3
Server Socket class

 Is a listener which waits for client to connect

Example 1

Java URL

 URL: it points to a resource on the world wide web

 URL contains:- protocol

server name or IP Address

Port number
4
File name or directory name Example 2
Java URLConnection Class

 Represents a communication link between the URL and the application

 Can be used to read and write data to the specified resource referred by the URL.

Example 3

Java DatagramSocket and DatagramPacket

 Classes are used for connectionless socket programming

5
 It is a mechanism that allows an object residing in one system (JVM) to
access/invoke an object running on another JVM.

 Used to build distributed applications

 It provides remote communication between java programs.

Architecture of RMI applications


Client Server

Stub Skeleton

RRL RRL

Transport Layer Transport Layer 6


Transport layer: Connects the client and the server. It manages the existing connection

Stub: Connects is a representation (proxy) of the remote object at a client. Acts as a


gateway for the client program.

Skeleton: this is the object which resides on the server side. Stub communicates with
this skeleton to pass request to the remote object.

RMI Registry

 Is a name space on which all server objects are palaced.

 Each time the server creates an object it registers this object using (bind() or rebind()
methods) 7
Client Server
Invokes the method

LookUp() reBind()

RMI Registry

You might also like