public static void main(String[] args) { log.info("Socket中关闭通讯通道失败"); ISocket so = null; try { so = new IOLenthSocket(); so.connect("172.28.250.111", 3737, 20); byte[] data = "{\"version\":\"ver1.0.0\",\"charset\":\"UTF-8\",\"accessChannelNo\":\"00000003\",\"accessType\":\"0001\",\"commType\":\"0001\",\"deviceType\":\"\",\"smpType\":\"M0025\",\"dType\":\"01\",\"deviceInfo\":{},\"tranAttribute\":\"\",\"monitorFiled\":{},\"routeFiled\":\"\",\"traceNo\":\"\",\"securityInfo\":{},\"clientInfo\":{},\"memId\":\"2396\"}" .getBytes("utf-8"); so.write(data, true); System.out.println("data send ok"); byte[] bb = so.read(); System.out.println(new String(bb, "utf-8")); } catch (Exception e) { e.printStackTrace(); } finally { if (so != null) try { so.close(); } catch (SSocketException e) { e.printStackTrace(); } } }