// These extension requests expect replies
XProtocolInfo.extensionRequestExpectsReply(major_opcode, 0, 32); // QueryVersion
XProtocolInfo.extensionRequestExpectsReply(major_opcode, 7, 32); // GetOverlayWindow
// check version before any other operations
Request request = new Request (display, major_opcode, 0, 3);
request.write4 (CLIENT_MAJOR_VERSION);
request.write4 (CLIENT_MINOR_VERSION);
Data reply = display.read_reply (request);
server_major_version = reply.read4 (8);
server_minor_version = reply.read4 (12);
}