HTTP Webserver Using Java

import java.net.*; import java.io.*; class myserver { public static void main(String str[]) { String myIp=null; int port=786; try{ //Get Systems current ip address myIp= Inet4Address.getLocalHost().getHostAddress(); System.out.println(“Server is Running with “+ myIp +”:”+ port); //Create Server Socket ServerSocket welcome = new ServerSocket(port); //Accept incomming connection Socket Socket sskt = welcome.accept(); PrintWriter out = new PrintWriter(sskt.getOutputStream()); //Create

Download webpage using java server socket.

Download webpage using java server socket.  import java.net.*; import java.io.*; class readWebPage { public static void main(String arg[]) { try{ Socket s = new Socket(“10.0.0.1″,8090); String line=””; BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream())); PrintWriter out = new PrintWriter(s.getOutputStream()); out.print(“GET /httpclient.htmlnn”); out.flush(); System.out.println(“Reading File”); while((line = in.readLine())!=null) { System.out.println(line); } } catch(Exception e) { System.out.println(e.toString()); }

Java HTTP Server and Client

Create chat application using either TCP protocol Making simple chat application using “Socket” Programming. Here is the code for TCP/IP Server and Client.  GTU; Practical 1: Advance  Java : Create chat application using either TCP  protocol   Code of Server /* * To change this license header, choose License Headers in Project Properties. * To change