package com.zhiwei.chendong;

import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class WechatMsgServer {

	public static void main(String[] args) throws Exception {
		ServerSocket server = new ServerSocket(22222);
		Socket socket = server.accept();
		InputStream in = socket.getInputStream();
		byte[] bytes = new byte[1024];
		int len;
		StringBuilder sb = new StringBuilder();
		while ((len = in.read(bytes)) != -1) {
			sb.append(new String(bytes, 0, len, "utf-8"));
		}
		OutputStream outputStream = socket.getOutputStream();
		in.close();
		outputStream.close();
		socket.close();
		server.close();
	}

}
