private void removeDevice(Device device) { device.clearClientList(); mDevices.remove(device); SocketChannel channel = device.getClientMonitoringSocket(); if (channel != null) { try { channel.close(); } catch (IOException e) { // doesn't really matter if the close fails. } } }
private void removeDevice(@NonNull Device device) { device.setState(DeviceState.DISCONNECTED); device.clearClientList(); mDevices.remove(device); SocketChannel channel = device.getClientMonitoringSocket(); if (channel != null) { try { channel.close(); } catch (IOException e) { // doesn't really matter if the close fails. } } }
Device device = (Device)attachment; SocketChannel socket = device.getClientMonitoringSocket();
Device device = (Device)attachment; SocketChannel socket = device.getClientMonitoringSocket();