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.SocketCreate;
import cn.net.cpzslibs.prot.handset.Prot32CarFanku;

public class YunCarText {


	public static void main(String[] args) {
		String ip = "218.245.0.108";// 218.245.0.109 192.168.0.46
		int port = 8898;
		SocketCreate create = new SocketCreate(ip, port, "");
		try {
			create.createLoginCpzsHandset(358000052L);
			Prot32CarFanku carFanku = new Prot32CarFanku();//声明协议对象
			carFanku.dealProt(create, 100010027968478L);
			
			System.out.println(carFanku.getiRecErrcode());
			
			/*//做盘库操作  
			Prot33CarPanku carPanku = new Prot33CarPanku();
			carPanku.dealProt(create, 1000010027811324L);
			System.out.println(carPanku.getJsonData());
			System.out.println(carPanku.getPankuBean());
			System.out.println(carPanku.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);
		}
	}



}
/**/