| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.zy.common.Cools; |
| | | import com.zy.common.SpringUtils; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.News; |
| | |
| | | try { |
| | | ServerSocket serverSocket = new ServerSocket(device.getPort()); |
| | | Socket fakeSocket = serverSocket.accept(); |
| | | |
| | | String fakeStatus = JSON.toJSONString(fakeStatusDemo); |
| | | if (!Cools.isEmpty(device.getFakeInitStatus())) { |
| | | fakeStatus = device.getFakeInitStatus(); |
| | | } |
| | | |
| | | fakeServerMap.put(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo(), fakeSocket); |
| | | fakeStatusMap.put(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo(), JSON.parseObject(JSON.toJSONString(fakeStatusDemo))); |
| | | fakeStatusMap.put(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo(), JSON.parseObject(fakeStatus)); |
| | | while (true) { |
| | | if(fakeSocket == null) { |
| | | fakeServerMap.remove(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo()); |