public void cancel() throws IOException {
SocketChannel closeChannel = SocketChannel.open();
closeChannel.configureBlocking(true);
closeChannel.connect(new InetSocketAddress(host, port));
ByteBuffer bytes = new CancelRequest(backendKeyData.getPid(), backendKeyData.getSecret()).toBytes();
closeChannel.write(bytes);
closeChannel.close();
}