Network/Socket Programming in Java: Rajkumar Buyya
Network/Socket Programming in Java: Rajkumar Buyya
Network/Socket Programming in Java: Rajkumar Buyya
Programming in Java
Rajkumar Buyya
Elements of C-S
Computing
Client
Re
qu
es
Server
Re
s
Client machine
Network
ul
Server machine
java.net
Used to manage:
URL streams
Client/server sockets
Datagrams
Output/write stream
Input/read stream
Socket(128.250.25.158, 1234)
Server_name: manjira.cs.mu.oz.au
Echo Server
System.out.println( "Server Down" );
try {
server.close();
} catch(IOException e) {}
}
}
Threads in Action...
Multithreaded Server
Server Process
Client
Process
Server
Threads
Client Process
User Mode
Kernel Mode
Message Passing
Facility
Client/Server Computing
Rajkumar Buyya
Elements of C-S
Computing
Client
Re
qu
es
Server
Re
s
Client machine
Network
ul
Server machine
CS-Focus is on
In client-server computing
major
focus
is
on
SOFTWARE
Application Tasks
User
UserInterface
Interface
Presentation
PresentationLogic
Logic
Application
ApplicationLogic
Logic
Data
DataRequests
Requests&
&Results
Results
Physical
PhysicalData
DataManagement
Management
ey
str
ok
Server
Client
Di
Presentation Logic
Network
sp
lay
s
Application Logic
DBMS
ey
str
ok
Server
Client
Application Logic
Presentation Logic
Network
Pr
o
Re ces
su se d
lts
DBMS
Distributed Client-Server
Model
Application Logic
Presentation Logic
Server
Pr
Q o ce
u e ss
r ie e d
s
Client
Application Logic
Network
Pr
o
Re ces
su se d
lts
DBMS
Client-server computing is
distributed access, not a distributed
computing.
server stub
network transport
request message
Network
Remote Procedure Call
reply message
reply message
request message
results
arguments
called
procedure
(client)
Local Procedure Call
network transport
results
results
arguments
results=
calling
procedure bar(arguments)
(client)
client stub
Server Machine
Service Daemon Listening
Client
Program
RPC Call
Client
Waiting
Netw
o
rk
return ( )
reply
return() answer
Service Executes
with Request
Invoke Service
Service Call
Request Completed
Multithreaded Server
Client
Process
Server Process
Server
Threads
Client Process
User Mode
Kernel Mode
Message Passing
Facility
Categories of Servers
File Server
Data Server
Compute Server
Database Server
Communication Server
Video Server
File Server
Compute Server
processors
with
high
capabilities
large amounts of memory
relatively low disk subsystems
performance
Data Server
Data
Server
Compute
Server
Database Server
Communication Server
Provides gateway to other LANs,
networks & Computers
E-mail Server & internet server
Modest system requirements
multiple slots
fast processor to translate
networking protocols
Internet Server
PC client
Internet Server
Local Area
Network
UNIX workstations
Distributed processing
application connects to remote
database
S Q L*
Forms
SQL *Net
TCP/IP
UNIX Server
SQL *Net
TCP/IP
SQL *
Forms
SQL *Net
TCP/IP
ORACL
E
ORACLE
Database Configurations
Client-Server Waves
Intergalactic era
client/server
Ethernet era
client/server
First Wave
File
servers
1982
1986
Second Wave
Database
servers
re
a
pw
u
gro
s
TPitor
n
mo
1990
1994
Third Wave
Distributed
objects
1998
The Client/Server
Infrastructure
Client
Middleware
Service Specific
SQL/IDAPI
GUI/OOUI
TxRPC
Server
ORB
DSM
SNMP
CMIP
DME
Operating System
Directory
Security
Distributed file
RPC
Messaging
Peer-to-peer
Transport Stack
NetBIOS
TCP/IP
Groupware
TP
monitor
NOS
DSM
Objects
IPX/SPX
SNA
DBMS
DSM
Operating System