728x90 Programming Language3 Spring boot start 2023. 12. 15. TCP/IP Socket java code + Keep-Alive 활성화 1. KeepAliveServer.java import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.ServerSocket; import java.net.Socket; public class KeepAliveServer { public static void main(String[] args) { try { // 서버 소켓 생성 ServerSocket serverSocket = new ServerSocket(1000); while (true) { // 클라이언트의 연결 대기 Socket clientSocket = serverSocket.accept(); // Keep-A.. 2023. 11. 17. TCP/IP Socket java code 1. Server.java import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; public class Server extends Thread { final static int SERVER_PORT = 1000; final static String MESSAGE_TO_SERVER = "Hello, Client"; public static void main(String[] args) { ServerSocket serverSocket = null; try { serverSocket = new ServerSocket(.. 2023. 11. 17. 이전 1 다음 728x90