Question
If you would like to use my HW1 as reference this is the code that was used for HW 1: CLIENT: import java.io.*; import java.net.*;
If you would like to use my HW1 as reference this is the code that was used for HW 1:
CLIENT:
import java.io.*; import java.net.*; import java.util.*;
public class Client {
public static void main(String argv[]) { try{ Socket socketClient = new Socket("localhost",5555); System.out.println("Client: "+" Connection Established"); BufferedReader reader = new BufferedReader(new InputStreamReader(socketClient.getInputStream())); BufferedWriter writer= new Bufferedwriter(new OutputStreamwriter(socketClient.getOutputStream())); String serverMsg; writer.write("8 "); writer.write("10 "); writer.flush(); while((serverMsg = reader.readLine())!= null) { System.out.println("Client:" + serverMsg); } }catch(Exception e){e.printStackTrace();} } }
SERVER:
import java.io.*; import java.net.*;
public class Server { public static void main(String argv[]) throws Exception { System.out.println(" Server is Running") ; ServerSocket mysocket = new ServerSocket(5555);
while(true) { Socket connectionSocket = mysocket.accept(); BufferedReader reader = new BufferedReader(new InputStreamReader (connectionsocket.getInputStream())); BufferedWriter writer = new Bufferedwriter(new OutputStreamWriter(connectionSocket.getOutputStream())); writer.write("*** Welcome to the calculation Server (Addition Only) *** "); writer.write("*** Please type in the first number and press Enter : "); writer.flush(); String data1 = reader.readLine().trim(); writer.write(*** Please type in the second number and press Enter : ");" writer.flush(); String data2 = reader.readLine().trim(); int num1=Integer.parseInt(data1); int num2=Integer.parseInt(data2);
int result=num1+num2;
Wireshark is the world's foremost network protocol analyzer. o www.wireshark.org E o Tutorial: Link Exploring HTTP o Use wireshark to capture the HTTP packets. You can capture your favorite applications and your own web service developed in HW1 Exploring TCP o Analyze your client- and server-side traces to explore aspects of TCP, e.g., window, packet loss, retransmission, flow control, congestion control, and estimated round trip time Exploring UDP o Investigate the header fields as well as the checksum. o Select any application, or you can write your own simple application, e.g., Python socket UDP Write the detailed report o Add your own screenshot mark your findingsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started