first commit

This commit is contained in:
Jose Caban
2025-06-07 01:59:34 -04:00
commit 388ac241f0
3558 changed files with 9116289 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import java.io.*;
import java.net.*;
class ClientExample {
public static final int PORT = 1234;
public static void main(String argv[]) {
try {
Socket s = new Socket("localhost", PORT);
BufferedReader br = new BufferedReader(new
InputStreamReader(s.getInputStream()));
PrintWriter pr = new PrintWriter(new
OutputStreamWriter(s.getOutputStream()));
System.out.println(s.getLocalAddress().toString());
System.out.println(s.getLocalSocketAddress().toString());
pr.println("Hello, world!");
pr.flush();
System.out.println(br.readLine());
} catch (IOException e) {
System.out.println("IO Exception: " + e.getMessage());
}
}
}