public static void main(String[] args) {

		AcceptThread a1 = null;
		AcceptThread a2 = null;
		AcceptThread a3 = null;
		try {

			a1 = new AcceptThread("a1", 6001);
			a1.startup();
			a2 = new AcceptThread("a2", new Socket("127.0.0.1", 6001), 6002);
			a2.startup();
			a3 = new AcceptThread("a3", new Socket("127.0.0.1", 6002), 6003);
			a3.startup();

			Socket client = new Socket("127.0.0.1", 6003);
			OutputStream os = client.getOutputStream();
			InputStream is = client.getInputStream();

			String str = "hello world";
			System.out.println("client send :" + str);
			os.write(str.getBytes());
			byte[] b = new byte[1024];
			int count = is.read(b);
			System.out.println("client read :" + new String(b, 0, count));

		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (a3 != null) {
				a3.shutdown();
			}
			if (a2 != null) {
				a2.shutdown();
			}
			if (a1 != null) {
				a1.shutdown();
			}
		}

	}