| | |
| | | } |
| | | |
| | | public void sendMessageToAll(String message) { |
| | | Map<String, Object> map = jsonToMap(message); |
| | | if (map.get("pid").equals("00000001")) { |
| | | System.out.println(message); |
| | | } |
| | | // Map<String, Object> map = jsonToMap(message); |
| | | // if (map.get("pid").equals("00000001")) { |
| | | // System.out.println(message); |
| | | // } |
| | | try { |
| | | List<Future<?>> futures = new ArrayList<>(); |
| | | wsServers.forEach(ws -> { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public static Map<String, Object> jsonToMap(String json) { |
| | | Gson gson = new Gson(); |
| | | Type type = new TypeToken<Map<String, Object>>() { |
| | | }.getType(); |
| | | return gson.fromJson(json, type); |
| | | } |
| | | // |
| | | // public static Map<String, Object> jsonToMap(String json) { |
| | | // Gson gson = new Gson(); |
| | | // Type type = new TypeToken<Map<String, Object>>() { |
| | | // }.getType(); |
| | | // return gson.fromJson(json, type); |
| | | // } |
| | | } |