package cn.net.test;

import java.io.IOException;
import java.net.BindException;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;

import cn.net.cpzslibs.prot.Prot02Logout;
import cn.net.cpzslibs.prot.Prot11DownConflictInfo;
import cn.net.cpzslibs.prot.SocketCreate;

public class MainCheckTest {

	/**
	 * <br/>
	 * 2015-6-3上午9:34:28
	 * 
	 * @param args
	 * @throws IOException
	 * @throws UnknownHostException
	 * @throws SocketTimeoutException
	 * @throws ConnectException
	 * @throws BindException
	 */
	public static void main(String[] args) {
		SocketCreate create = new SocketCreate("192.168.0.46", 8898,
				"A100003F289D241");
		try {
			create.createLoginCpzsCheck(358000018);
			if (create.isResult()) {
				Prot11DownConflictInfo conflictInfo = new Prot11DownConflictInfo();
//				conflictInfo.dealDownConflictInfo(create, 1);
				conflictInfo.dealAllConflictInfo(create, 10000);
				System.out.println(conflictInfo.getJsonData());
			}else{
				System.out.println("登录失败"+create.getErrMsg());
			}
		} catch (BindException e) {
			e.printStackTrace();
		} catch (ConnectException e) {
			e.printStackTrace();
		} catch (SocketTimeoutException e) {
			e.printStackTrace();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			new Prot02Logout().dealLogout(create);
		}

	}

}
