(String s)
| 37 | } |
| 38 | |
| 39 | public void sendMessage(String s) throws IOException { |
| 40 | synchronized (socketChannel) { |
| 41 | ByteBuffer buf = ByteBuffer.wrap((s + "\n").getBytes(StandardCharsets.UTF_8)); |
| 42 | |
| 43 | while (buf.hasRemaining()) { |
| 44 | socketChannel.write(buf); |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | @Override |
| 50 | public void close() throws IOException { |
no test coverage detected