diff --git a/CSE-VI-B/Client.java b/CSE-VI-B/Client.java new file mode 100644 index 00000000..ffcf6a59 --- /dev/null +++ b/CSE-VI-B/Client.java @@ -0,0 +1,27 @@ +import java.io.*; +import java.net.*; + +public class Client{ + public static void main(String[] args){ + try{ + Socket s = new Socket("localhost", 1234); + DataOutputStream dout = new DataOutputStream(s.getOutputStream()); + DataInputStream din = new DataInputStream(s.getInputStream()); + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + String str = "", str2 = ""; + while(!str.equals("bye")){ + str = br.readLine(); + dout.writeUTF(str); + dout.flush(); + str2 = din.readUTF(); + System.out.println("Server: " + str2); + } + din.close(); + s.close(); + } + catch(Exception e){ + System.out.println(e); + } + } +} \ No newline at end of file diff --git a/CSE-VI-B/Q2clientOutput.jpeg b/CSE-VI-B/Q2clientOutput.jpeg new file mode 100644 index 00000000..1a6b556e Binary files /dev/null and b/CSE-VI-B/Q2clientOutput.jpeg differ diff --git a/CSE-VI-B/Q2serverOutput.jpeg b/CSE-VI-B/Q2serverOutput.jpeg new file mode 100644 index 00000000..430927f6 Binary files /dev/null and b/CSE-VI-B/Q2serverOutput.jpeg differ diff --git a/CSE-VI-B/Q3output.jpeg b/CSE-VI-B/Q3output.jpeg new file mode 100644 index 00000000..1bc2e956 Binary files /dev/null and b/CSE-VI-B/Q3output.jpeg differ diff --git a/CSE-VI-B/Q3output2.jpeg b/CSE-VI-B/Q3output2.jpeg new file mode 100644 index 00000000..66793bcd Binary files /dev/null and b/CSE-VI-B/Q3output2.jpeg differ diff --git a/CSE-VI-B/Server.java b/CSE-VI-B/Server.java new file mode 100644 index 00000000..bebbce56 --- /dev/null +++ b/CSE-VI-B/Server.java @@ -0,0 +1,30 @@ +//created by shilpisharma +import java.io.*; +import java.net.*; + +public class Server{ + public static void main(String[] args){ + try{ + ServerSocket ss = new ServerSocket(1234); + Socket s = ss.accept(); + System.out.println("Online"); + DataInputStream din = new DataInputStream(s.getInputStream()); + DataOutputStream dout = new DataOutputStream(s.getOutputStream()); + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + String str = "", str2 = ""; + while(!str.equals("bye")){ + str = din.readUTF(); + System.out.println("Client: " + str); + str2 = br.readLine(); + dout.writeUTF(str2); + dout.flush(); + } + din.close(); + ss.close(); + s.close(); + } + catch(Exception e){ + System.out.println(e); + } + } +} \ No newline at end of file diff --git a/CSE-VI-B/ShilpiSharma_1018592 b/CSE-VI-B/ShilpiSharma_1018592 new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/CSE-VI-B/ShilpiSharma_1018592 @@ -0,0 +1 @@ + diff --git a/CSE-VI-B/ShilpiSharma_1018592_55 b/CSE-VI-B/ShilpiSharma_1018592_55 new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/CSE-VI-B/ShilpiSharma_1018592_55 @@ -0,0 +1 @@ +