()
| 131 | }, "Connection to " + host).start(); |
| 132 | return new Close() { |
| 133 | @Override |
| 134 | public void close() throws IOException { |
| 135 | while (connection[0] == null) { |
| 136 | try { |
| 137 | Thread.sleep(200); |
| 138 | } catch (InterruptedException e) { |
| 139 | Log.e(e); |
| 140 | throw new RuntimeException(e.getMessage(), e); |
| 141 | } |
| 142 | } |
| 143 | if (Util.getImplementation().isSocketConnected(connection[0])) { |
| 144 | Util.getImplementation().disconnectSocket(connection[0]); |
| 145 | } |
| 146 | connection[0] = null; |
| 147 | } |
| 148 | }; |
| 149 | } |
| 150 |
no test coverage detected