use of com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClientSynch in project orientdb by orientechnologies.
the class OServerShutdownMain method connect.
public void connect(final int iTimeout) throws IOException {
// TRY TO CONNECT TO THE RIGHT PORT
for (int port : networkPort) try {
channel = new OChannelBinaryAsynchClientSynch(networkAddress, port, null, contextConfig);
break;
} catch (Exception e) {
OLogManager.instance().error(this, "Error on connecting to %s:%d", e, networkAddress, port);
}
if (channel == null)
throw new ONetworkProtocolException("Cannot connect to server host '" + networkAddress + "', ports: " + Arrays.toString(networkPort));
channel.writeByte(OChannelBinaryProtocol.REQUEST_SHUTDOWN);
channel.writeInt(0);
channel.writeString(rootUser);
channel.writeString(rootPassword);
channel.flush();
channel.beginResponse(0, false);
}
Aggregations