Merge pull request #9624 from luvarqpp/patch-1
Fix exception when receiving POISON_PILL
This commit is contained in:
commit
26f21645a4
|
@ -49,11 +49,11 @@ public class EchoServer {
|
|||
if (new String(buffer.array()).trim().equals(POISON_PILL)) {
|
||||
client.close();
|
||||
System.out.println("Not accepting client messages anymore");
|
||||
} else {
|
||||
buffer.flip();
|
||||
client.write(buffer);
|
||||
buffer.clear();
|
||||
}
|
||||
|
||||
buffer.flip();
|
||||
client.write(buffer);
|
||||
buffer.clear();
|
||||
}
|
||||
|
||||
private static void register(Selector selector, ServerSocketChannel serverSocket) throws IOException {
|
||||
|
|
Loading…
Reference in New Issue