import java.net.Socket; import java.io.*; public class Q2Client { private Socket s; public static void main(String[] args) { System.out.println("Runing Client"); Q2Client client = new Q2Client(); client.run(); } public void run() { try { s = new Socket("localhost", 4321); DataOutputStream dout=new DataOutputStream(s.getOutputStream()); dout.writeUTF("Hello"); //Setup_Request //dout.flush(); dout.close(); s.close(); } catch (Exception e) { System.out.println("Client Socket failed to connect."); } } }