return;
}
boolean running = false;
String id = prop.getProperty("id");
try {
Socket socket = NetUtils.createSocket(server, Constants.DEFAULT_TCP_PORT, false);
Transfer transfer = new Transfer(null);
transfer.setSocket(socket);
transfer.init();
transfer.writeInt(Constants.TCP_PROTOCOL_VERSION_6);
transfer.writeInt(Constants.TCP_PROTOCOL_VERSION_9);
transfer.writeString(null);
transfer.writeString(null);
transfer.writeString(id);
transfer.writeInt(SessionRemote.SESSION_CHECK_KEY);
transfer.flush();
int state = transfer.readInt();
if (state == SessionRemote.STATUS_OK) {
running = true;
}
transfer.close();
socket.close();
} catch (IOException e) {
return;
}
if (running) {
DbException e = DbException.get(ErrorCode.DATABASE_ALREADY_OPEN_1, "Server is running");