network2 ChatClient package examples.network; import java.net.*;import java.io.*; public class ChatClient { public static void main(String[] args) {if(args.length != 2){System.out.println("사용법 : java ChatClient id 접속할서버ip");System.exit(1);}Socket sock = null;BufferedReader br = null;PrintWriter pw = null;boolean endflag = false;try{sock = new Socket(args[1], 10001);pw = new PrintWriter(new OutputStreamWriter(sock.g.. 2016. 1. 22. Echo package kr.co.smu.network; import java.io.BufferedReader;import java.io.InputStreamReader;import java.io.PrintWriter;import java.net.Socket; public class EchoClient { public static void main(String[] args) {try{Socket socket = new Socket("127.0.0.1", 10001);BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));BufferedReader in = new BufferedReader(new InputStreamReader(.. 2016. 1. 22. 이전 1 다음