SlideShare a Scribd company logo
IADCS Diploma Course Java Network Programming U Nyein Oo COO/Director(IT) Myanma Computer Co., Ltd
Objectives Introduction to Internet and its working Network Protocol TCP and UDP Explain Client/Server computing  Classes of  java.net  package:  InetAddress Socket ServerSocket DatagramSocket DatagramPacket
Objectives(cont) Explain Web related classes: URL Class   URLConnection Class   URLEncoder Class   ContentHandler Class
Networking and Internet Networking is the concept of connecting two machines Internet is nothing but many computers communicating with each other using protocols
Protocol Protocols help in passing information from one computer to another   Computers communicate with each other by exchanging packets of data  Internet Protocol (IP) is the network protocol used to send information from one computer to another over the Internet
Protocol (Contd…) The communication of computers is possible using Ports   Commonly used port numbers  Port No Protocol Description 21 FTP File Transfer Protocol 23 TELNET Remote Login 25 SMTP Simple Mail Transfer Protocol
TCP and UDP Communication takes place with the help of transport protocols TCP establishes link between the source port’s IP address and destination port’s IP address
TCP and UDP (Contd…) UDP is a connectionless protocol as it does not establish a link for the connection   When UDP is used, the destination port and IP addresses are written down in a datagram and the datagram is sent to the destination  UDP   is less reliable as compared to TCP since there is no delivery assurance
Client Server Computing The Net provides a variety of services; these services are organized according to the client/server architecture The client programs like browsers create connections to server programs such as Web and FTP servers
Client Server Computing (Contd…) The client makes the request to the server and the server responds by providing the required service to the client Clients communicate through client sockets and servers communicate through server sockets
Inside java.net The  java.net  package provides the classes that support socket-based client/server communication   Classes of   java.net package:  InetAddress Socket ServerSocket DatagramSocket DatagramPacket
InetAddress Class   This class eases finding of addresses on the Internet   Only the name needs to be supplied to get the respective address It supports both numeric IP address and hostnames
Socket Class Java programs connect to the network using a socket Socket helps in establishing connections and developing applications between the client and server
ServerSocket Class The TCP server socket is implemented using the ServerSocket class   The server socket is made to listen using the  accept( )  method and thereby wait till an incoming connection is established   The address of the host to which the socket is connected is returned using  getInetAddress( )  method
DatagramSocket Class   This class is used to implement the client and server sockets using the  User Datagram Protocol  (UDP) UDP is a connectionless protocol that enables client and server to exchange information using datagrams   Datagrams are nothing but chunks of data   The datagrams are sent and received using the  send( )  and  receive( )  methods respectively
DatagramPacket Class   This class encapsulates the datagrams that are sent and received using objects of DatagramSocket   class There are two different constructors, one for datagrams that are received from the datagram socket and the other for creating datagrams that are sent over the datagram socket
Web related classes While working with the Internet and World Wide Web, we need to create and manipulate URLs The  java.net  package also provides a set of classes that support Web-specific applications  java.net  web-related classes: URL URLConnection URLEncoder  ContentHandler
URL Class   URL stands for  Uniform Resource Locator   It provides a uniform way to locate resources on the web The class  java.net.URL  encapsulates the object on the web
URLConnection   Class   It is an abstract class   If we have an active HTTP connection to the web, the URLConnection class encapsulates it This class supports several methods so as to modify the defaults, query and modify the current settings for a URLConnection object  URLConnection class is used for getting information about the web object and the connection to the web object so as to interact with the web object HttpURLConnection  is a subclass of the URLConnection class
URLEncoder Class   This class is basically used for converting text strings to a suitable form useable as part of an URL   This class provides method called  encode( )  that converts the spaces in the text to plus sign (+)  It uses a percent character (%) as an escape code for encoding special characters
ContentHandler Class   ContentHandler class is used to process and extract data with  MIME (Multipurpose Internet Mail Extension)  types   MIME includes different types of objects such as sounds, images, videos, etc.   It provides viewers to process MIME types

More Related Content

PPT
Java Network Programming
backdoor
 
PPT
Java networking
Arati Gadgil
 
PPTX
Advance Java-Network Programming
ashok hirpara
 
PPT
Ipc
Mohd Tousif
 
PPT
Java API: java.net.InetAddress
Sayak Sarkar
 
PPTX
Java
Subha Selvam
 
PPT
Remote method invocation
MNM Jain Engineering College
 
PDF
CS6601 DISTRIBUTED SYSTEMS
Kathirvel Ayyaswamy
 
Java Network Programming
backdoor
 
Java networking
Arati Gadgil
 
Advance Java-Network Programming
ashok hirpara
 
Java API: java.net.InetAddress
Sayak Sarkar
 
Remote method invocation
MNM Jain Engineering College
 
CS6601 DISTRIBUTED SYSTEMS
Kathirvel Ayyaswamy
 

What's hot (20)

PPTX
Java 1
VidyaVarshini3
 
DOC
Socket
Amandeep Kaur
 
PDF
Ipc
deepakittude
 
PPT
Peer to Peer services and File systems
MNM Jain Engineering College
 
PPT
Chapter 4 slides
lara_ays
 
PPT
The Internet and World Wide Web
webhostingguy
 
PPTX
Chapter 4
Ebisa Bekele
 
PPT
Inter-Process Communication (IPC) techniques on Mac OS X
HEM DUTT
 
PPT
Application layer protocols
JUW Jinnah University for Women
 
PPT
Application layer protocols
N.Jagadish Kumar
 
PPTX
Apple continuity
HEM DUTT
 
PPTX
Message queuing telemetry transport (mqtt) launch
Hamdamboy
 
PPTX
Message queuing telemetry transport (mqtt) topic parameters
Hamdamboy
 
PPTX
Unit 3 cs6601 Distributed Systems
Nandakumar P
 
PPTX
Message queuing telemetry transport (mqtt)and part 3 and summarizing
Hamdamboy
 
PPTX
Web Terminology
TanimSharia
 
PPT
XMPP For Cloud Computing
Bluendo
 
PDF
Ch1 computer networks internet_encapsulation_4
Syed Ariful Islam Emon
 
PDF
Sample ch10 corr-maurer_netty_december03
Milena Stefanova
 
PPTX
Secure erasure code based distributed storage system with secure data forwarding
Ali Habeeb
 
Peer to Peer services and File systems
MNM Jain Engineering College
 
Chapter 4 slides
lara_ays
 
The Internet and World Wide Web
webhostingguy
 
Chapter 4
Ebisa Bekele
 
Inter-Process Communication (IPC) techniques on Mac OS X
HEM DUTT
 
Application layer protocols
JUW Jinnah University for Women
 
Application layer protocols
N.Jagadish Kumar
 
Apple continuity
HEM DUTT
 
Message queuing telemetry transport (mqtt) launch
Hamdamboy
 
Message queuing telemetry transport (mqtt) topic parameters
Hamdamboy
 
Unit 3 cs6601 Distributed Systems
Nandakumar P
 
Message queuing telemetry transport (mqtt)and part 3 and summarizing
Hamdamboy
 
Web Terminology
TanimSharia
 
XMPP For Cloud Computing
Bluendo
 
Ch1 computer networks internet_encapsulation_4
Syed Ariful Islam Emon
 
Sample ch10 corr-maurer_netty_december03
Milena Stefanova
 
Secure erasure code based distributed storage system with secure data forwarding
Ali Habeeb
 
Ad

Viewers also liked (15)

PDF
aLisa's scribe #2
alisasaaysRAWR
 
PPT
UC Nursing CDSDEV 2 Q
ucnursingcesdev
 
PPT
Week 2 Slidecast: Networked Information
Axel Bruns
 
PPT
UC Nursing CESDEV 2 I
ucnursingcesdev
 
PPT
UC Nursing CESDEV 3 I
ucnursingcesdev
 
PDF
Egypt & Jordan Calendar2006
devinsu
 
PPT
Transition
Nicole Sprainger
 
PPT
Labtec
guest91856a
 
PPT
KV PP Alumni Feb, 2008
guest4abb54
 
PPS
UC Nursing CESDEV 3 Aa Langob Outreach Ppt Show
ucnursingcesdev
 
PPT
Arson In Korea’S Historical Treasure
chrisy00
 
PPT
Uncertain Future in Kenya
AL1
 
PPT
PresentacióN1
guibol
 
PPT
Mahoney
guest023cff
 
aLisa's scribe #2
alisasaaysRAWR
 
UC Nursing CDSDEV 2 Q
ucnursingcesdev
 
Week 2 Slidecast: Networked Information
Axel Bruns
 
UC Nursing CESDEV 2 I
ucnursingcesdev
 
UC Nursing CESDEV 3 I
ucnursingcesdev
 
Egypt & Jordan Calendar2006
devinsu
 
Transition
Nicole Sprainger
 
Labtec
guest91856a
 
KV PP Alumni Feb, 2008
guest4abb54
 
UC Nursing CESDEV 3 Aa Langob Outreach Ppt Show
ucnursingcesdev
 
Arson In Korea’S Historical Treasure
chrisy00
 
Uncertain Future in Kenya
AL1
 
PresentacióN1
guibol
 
Mahoney
guest023cff
 
Ad

Similar to Java Network Programming 1197644949195966 4 (20)

PPT
Md13 networking
Rakesh Madugula
 
PDF
28 networking
Ravindra Rathore
 
PDF
Networking
Tuan Ngo
 
PPTX
Networking
Jafar Nesargi
 
PPTX
Java networking
ssuser3a47cb
 
PDF
Networking in java, Advanced programming
Gera Paulos
 
PPT
Network programming in Java
Tushar B Kute
 
PPTX
IPT Chapter 2 Web Services and Middleware - Dr. J. VijiPriya
VijiPriya Jeyamani
 
PPT
Network Programming in Java
Tushar B Kute
 
PPTX
Java seminar.pptx
shirindigitel
 
PPT
chapter-4-networking hjgjjgj did hfhhfhj
AmitDeshai
 
PDF
Networking Basics1ofjavaprogramming.pptx.pdf
omkarthombare4989
 
PDF
Unit 6 - Netwohhhhhddddrking in Java.pdf
kassyemariyam21
 
PPT
Networking Java Socket Programming
Mousmi Pawar
 
PPTX
Networking in Java
Tushar B Kute
 
PDF
Ajp notes-chapter-04
Ankit Dubey
 
PPTX
Java socket programming
Mohammed Abdalla Youssif
 
PPTX
Session 6
Parthipan Parthi
 
PPT
Network programming in Java
Tushar B Kute
 
PDF
Java Network Programming Third Edition 3rd Edition Elliotte Rusty Harold
dxvpbvqlbt970
 
Md13 networking
Rakesh Madugula
 
28 networking
Ravindra Rathore
 
Networking
Tuan Ngo
 
Networking
Jafar Nesargi
 
Java networking
ssuser3a47cb
 
Networking in java, Advanced programming
Gera Paulos
 
Network programming in Java
Tushar B Kute
 
IPT Chapter 2 Web Services and Middleware - Dr. J. VijiPriya
VijiPriya Jeyamani
 
Network Programming in Java
Tushar B Kute
 
Java seminar.pptx
shirindigitel
 
chapter-4-networking hjgjjgj did hfhhfhj
AmitDeshai
 
Networking Basics1ofjavaprogramming.pptx.pdf
omkarthombare4989
 
Unit 6 - Netwohhhhhddddrking in Java.pdf
kassyemariyam21
 
Networking Java Socket Programming
Mousmi Pawar
 
Networking in Java
Tushar B Kute
 
Ajp notes-chapter-04
Ankit Dubey
 
Java socket programming
Mohammed Abdalla Youssif
 
Session 6
Parthipan Parthi
 
Network programming in Java
Tushar B Kute
 
Java Network Programming Third Edition 3rd Edition Elliotte Rusty Harold
dxvpbvqlbt970
 

Recently uploaded (20)

PDF
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PDF
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
PDF
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
This slide provides an overview Technology
mineshkharadi333
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Software Development Methodologies in 2025
KodekX
 
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 

Java Network Programming 1197644949195966 4

  • 1. IADCS Diploma Course Java Network Programming U Nyein Oo COO/Director(IT) Myanma Computer Co., Ltd
  • 2. Objectives Introduction to Internet and its working Network Protocol TCP and UDP Explain Client/Server computing Classes of java.net package: InetAddress Socket ServerSocket DatagramSocket DatagramPacket
  • 3. Objectives(cont) Explain Web related classes: URL Class URLConnection Class URLEncoder Class ContentHandler Class
  • 4. Networking and Internet Networking is the concept of connecting two machines Internet is nothing but many computers communicating with each other using protocols
  • 5. Protocol Protocols help in passing information from one computer to another Computers communicate with each other by exchanging packets of data Internet Protocol (IP) is the network protocol used to send information from one computer to another over the Internet
  • 6. Protocol (Contd…) The communication of computers is possible using Ports Commonly used port numbers Port No Protocol Description 21 FTP File Transfer Protocol 23 TELNET Remote Login 25 SMTP Simple Mail Transfer Protocol
  • 7. TCP and UDP Communication takes place with the help of transport protocols TCP establishes link between the source port’s IP address and destination port’s IP address
  • 8. TCP and UDP (Contd…) UDP is a connectionless protocol as it does not establish a link for the connection When UDP is used, the destination port and IP addresses are written down in a datagram and the datagram is sent to the destination UDP is less reliable as compared to TCP since there is no delivery assurance
  • 9. Client Server Computing The Net provides a variety of services; these services are organized according to the client/server architecture The client programs like browsers create connections to server programs such as Web and FTP servers
  • 10. Client Server Computing (Contd…) The client makes the request to the server and the server responds by providing the required service to the client Clients communicate through client sockets and servers communicate through server sockets
  • 11. Inside java.net The java.net package provides the classes that support socket-based client/server communication Classes of java.net package: InetAddress Socket ServerSocket DatagramSocket DatagramPacket
  • 12. InetAddress Class This class eases finding of addresses on the Internet Only the name needs to be supplied to get the respective address It supports both numeric IP address and hostnames
  • 13. Socket Class Java programs connect to the network using a socket Socket helps in establishing connections and developing applications between the client and server
  • 14. ServerSocket Class The TCP server socket is implemented using the ServerSocket class The server socket is made to listen using the accept( ) method and thereby wait till an incoming connection is established The address of the host to which the socket is connected is returned using getInetAddress( ) method
  • 15. DatagramSocket Class This class is used to implement the client and server sockets using the User Datagram Protocol (UDP) UDP is a connectionless protocol that enables client and server to exchange information using datagrams Datagrams are nothing but chunks of data The datagrams are sent and received using the send( ) and receive( ) methods respectively
  • 16. DatagramPacket Class This class encapsulates the datagrams that are sent and received using objects of DatagramSocket class There are two different constructors, one for datagrams that are received from the datagram socket and the other for creating datagrams that are sent over the datagram socket
  • 17. Web related classes While working with the Internet and World Wide Web, we need to create and manipulate URLs The java.net package also provides a set of classes that support Web-specific applications  java.net web-related classes: URL URLConnection URLEncoder ContentHandler
  • 18. URL Class URL stands for Uniform Resource Locator It provides a uniform way to locate resources on the web The class java.net.URL encapsulates the object on the web
  • 19. URLConnection Class It is an abstract class If we have an active HTTP connection to the web, the URLConnection class encapsulates it This class supports several methods so as to modify the defaults, query and modify the current settings for a URLConnection object URLConnection class is used for getting information about the web object and the connection to the web object so as to interact with the web object HttpURLConnection is a subclass of the URLConnection class
  • 20. URLEncoder Class This class is basically used for converting text strings to a suitable form useable as part of an URL This class provides method called encode( ) that converts the spaces in the text to plus sign (+) It uses a percent character (%) as an escape code for encoding special characters
  • 21. ContentHandler Class ContentHandler class is used to process and extract data with MIME (Multipurpose Internet Mail Extension) types MIME includes different types of objects such as sounds, images, videos, etc. It provides viewers to process MIME types