mirror of
https://github.com/zach-sb/SENG2250_Assignment3.git
synced 2025-11-09 04:47:36 +11:00
37 lines
794 B
Java
37 lines
794 B
Java
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.");
|
|
}
|
|
}
|
|
} |