~cpp import java.io.*; import java.net.*; public class SimpleServerSocketTest { public static void main(String[] args) throws IOException { ServerSocket server=new ServerSocket(10000); System.out.println(server); System.out.println("접속을 기다립니다."); Socket accepted=server.accept(); System.out.println(accepted); accepted.close(); System.out.println("종료합니다.\n"); } }
~cpp import java.io.*; import java.net.*; public class SimpleSocketTest { public static void main(String[] args) throws IOException { Socket connect=new Socket("165.194.17.85", 10000);//서버 컴퓨터의 IP였음 System.out.println(connect); connect.close(); } }