
소켓 프로그래밍: TCP와 UDP(3)
·
자바/네트워킹
3-6. 소켓 프로그래밍을 이해하기 위한 예제(6) : 채팅 프로그램을 만드는 예제이다. ( 아래는 서버 프로그램이다. ) package Networking; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; import java.util.Scanner; public class Exercise011 { public static void main(String[] args) { ServerSocket serverSocket = null; Socket socket = null; try { // 서버소..