







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








Introduction^ An
Today’s Lecture
InetAddress Class
Example: Getting an Instance of InetAddress
import java.net.*; public class InetTest { public static void main(String args[]) { try { //getting the Inet Object for a host InetAddress host = InetAddress.getByName("home"); }catch(UnknownHostException ex) { System.out.println("Unknown host"); return; } } }
The Socket Class
Opening a Client Socket
Communicating with socket
Opening Streams of Client Socket
Socket conn=new Socket("home",5217);
Reading and Writing to sockets