Upload
kanchan-mahajan
View
226
Download
0
Embed Size (px)
Citation preview
8/16/2019 What is What is Java Networking?
http://slidepdf.com/reader/full/what-is-what-is-java-networking 1/3
What is Java Networking?
The phrase system development represents composing applications that work
across several gadgets (computers), in which the gadgets are all linked witheach other using a system.
The Java.net program of the J2SE !"s contains a selection of sessions and
connections that o#er the low$level interaction information, helping you to
create applications that concentrate on %&ing the issue taking place.
Port Number
The slot variety is used to e&clusively recogni'e di#erent applications. "t serves
as a interaction endpoint etween applications.
The slot variety is associated with the "! deal with for interaction etween two
applications.
Socket
n outlet is an endpoint etween two way interaction.
MAC Address
* (edia ccessiility *ontrol) ddress is a e&clusive identi%er of +"*
(+etwork "nterface *ontroller). system node can have several +"* ut each
with e&clusive *.
IP Address
"! deal with is a e&clusive variety allocated to a node of a system e.g.
-2./.0. . "t is consists of octets that variety from 0 to 211.
. "t is a sensile deal with that can e modi%ed.
2. *onnection$oriented and connection$less protocol
. "n connection$oriented method, recognition is sent y the recipient. So it is
e3cient ut slowly. The e&le of connection$oriented method is T*!.
8/16/2019 What is What is Java Networking?
http://slidepdf.com/reader/full/what-is-what-is-java-networking 2/3
4. 5ut, in connection$less method, recognition is not sent y the recipient. So it is
not e3cient ut 6uick. The e&le of connection$less method is 78!.
TCP
T*! is a e3cient, in$order transportation method. Every system deliver y the
source is going to reach its location in the same purchase as it was sent. The
restriction for T*!9"! is there can only e one emailer and one recipient.
ulticasting is not reinforced.
UP
78! does not assurance an purchase of system distriution, it does not even
assurance that software will e sent to its location. 78! is easier than T*!, with
less e&pense (shorter headlines and no system series variety, no re$
transmission). "t is often used for providing video9voice over a "! system (:o"!).
78! facilitates multicast, where one system can e otained y everyone
ecoming a memer of the multicast team (within the time$to$live variety of
trips from the sender).
Socket !or Port"
Socket is a end$point for social media interaction. T*! and 78! facilitates 4;
electrical sockets, from outlet variety 0 to outlet variety 1,11. Socket variety
etween 0 to 02 are arranged for popular application methods (e.g., Slot /0
for <TT!, Slot 44 for <TT!S, Slot 2 for =T!, Slot 2 for Telnet, Slot 21 for
ST!, Slot 0 for !>!, etc
Socket Programming#
Sockets provide the interaction procedure etween two computer systems
using T*!. customer system makes a outlet on its end of the interaction and
e#orts to plug that outlet to a we server.
?hen the relationship is made, the we server makes a outlet item on its end
of the interaction. The consumer and we server can now connect y writing to
and studying from the outlet.
The Java$net$Socket category symoli'es a outlet, and the
Java.net.ServerSocket category provides a procedure for the we server system
8/16/2019 What is What is Java Networking?
http://slidepdf.com/reader/full/what-is-what-is-java-networking 3/3
to pay attention for customers and set up relationships with them.
The following steps happen when creating a T*! relationship etween two
computer systems using sockets@
The we server instantiates a ServerSocket item, denoting which port variety
interaction is to happen on.
The we server creates the accept() techni6ue of the ServerSocket category.
This approach stays until a customer Aoins to the we server on the given port.
fter the we server holds ack, a customer instantiates a Socket item,
specifying the we server name and port variety to get linked to.
The constructor of the Socket category e#orts to plug the customer to the
speci%ed we server and port variety. "f interaction created, the customer now
has a Socket item capale of contacting the we server.
>n the we server side, the accept() techni6ue pro%ts a referrals to a new
outlet on the we server that is linked to the customerBs outlet.
Cead ore @ New Trends in Java