Professional Documents
Culture Documents
Networking:-
• Networking is a concept of connecting two or more
computing devices together so that we can share
resources.
• Advantage:-
• 1)IP Address
• 2)Protocol
• 3)Port Number
• 4)Connection-oriented and connectionless protocol
• 5)Socket
• • Scenario:-
• > Client connects to a server and queries for certain
• information
• > Server considers the query and returns information
• on it to the client
• Connection-Oriented
• Connection-Less
1. InetAddress
2. Socket
3. ServerSocket
4. DatagramSocket
5. DatagramPacket
6. URL
7. URLConnection
• A x = A.getA();
• A y = A.getA();
• S.o.p(x==y) //true.
• getLocalHost()-
• is used to obtain an InetAddress object for the IP address
of current machine.
• getHostName()-
• is used to obtain the host name.
• public String getHostName();
• (Demos)
• ex:-
• http://www.infomatics.info/AboutUs.aspx
• 1) getProtocol()
• is used to returns the protocol of the URL.
• 2)getHost()
• it returns the Host name of the URL.
• Demo