| | |
| | | |
| | | //发出请求 |
| | | private JSONObject requestCommand(NyShuttleHttpCommand httpCommand) throws IOException { |
| | | try { |
| | | if (this.socket == null) { |
| | | return null; |
| | | } |
| | |
| | | } |
| | | } |
| | | return result;//返回Body结果集 |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private void requestCommandAsync(NyShuttleHttpCommand httpCommand) throws IOException { |
| | |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | //压缩数据包 |
| | | JSONObject data = JSON.parseObject(JSON.toJSONString(httpCommand)); |
| | | data.remove("nodes"); |
| | |
| | | writer.write(JSON.toJSONString(data) + "\r\n"); |
| | | writer.flush(); |
| | | // System.out.println("Sent message to server: " + JSON.toJSONString(httpCommand)); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | private JSONObject filterBodyData(JSONObject data) { |