/** * Test port. * * @throws Exception If failed. */ @Test public void testPortRange() throws Exception { check(new ClientConnectorConfiguration().setPortRange(-1), false); check(new ClientConnectorConfiguration().setPortRange(0), true); checkJdbc(null, ClientConnectorConfiguration.DFLT_PORT); check(new ClientConnectorConfiguration().setPortRange(10), true); checkJdbc(null, ClientConnectorConfiguration.DFLT_PORT + 1); }
cliConnCfg.setMaxOpenCursorsPerConnection(sqlConnCfg.getMaxOpenCursorsPerConnection()); cliConnCfg.setPort(sqlConnCfg.getPort()); cliConnCfg.setPortRange(sqlConnCfg.getPortRange()); cliConnCfg.setSocketSendBufferSize(sqlConnCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(sqlConnCfg.getSocketReceiveBufferSize()); cliConnCfg.setPortRange(hostAndPort.portTo() - hostAndPort.portFrom()); cliConnCfg.setThreadPoolSize(odbcCfg.getThreadPoolSize()); cliConnCfg.setSocketSendBufferSize(odbcCfg.getSocketSendBufferSize());
/** * Reads the client connector configuration. * * @param in Reader. * @return Config. */ private static ClientConnectorConfiguration readClientConnectorConfiguration(BinaryRawReader in) { return new ClientConnectorConfiguration() .setHost(in.readString()) .setPort(in.readInt()) .setPortRange(in.readInt()) .setSocketSendBufferSize(in.readInt()) .setSocketReceiveBufferSize(in.readInt()) .setTcpNoDelay(in.readBoolean()) .setMaxOpenCursorsPerConnection(in.readInt()) .setThreadPoolSize(in.readInt()) .setIdleTimeout(in.readLong()) .setThinClientEnabled(in.readBoolean()) .setOdbcEnabled(in.readBoolean()) .setJdbcEnabled(in.readBoolean()); }
cliConnCfg.setMaxOpenCursorsPerConnection(sqlConnCfg.getMaxOpenCursorsPerConnection()); cliConnCfg.setPort(sqlConnCfg.getPort()); cliConnCfg.setPortRange(sqlConnCfg.getPortRange()); cliConnCfg.setSocketSendBufferSize(sqlConnCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(sqlConnCfg.getSocketReceiveBufferSize()); cliConnCfg.setPortRange(hostAndPort.portTo() - hostAndPort.portFrom()); cliConnCfg.setThreadPoolSize(odbcCfg.getThreadPoolSize()); cliConnCfg.setSocketSendBufferSize(odbcCfg.getSocketSendBufferSize());
/** * Reads the client connector configuration. * * @param in Reader. * @return Config. */ private static ClientConnectorConfiguration readClientConnectorConfiguration(BinaryRawReader in) { return new ClientConnectorConfiguration() .setHost(in.readString()) .setPort(in.readInt()) .setPortRange(in.readInt()) .setSocketSendBufferSize(in.readInt()) .setSocketReceiveBufferSize(in.readInt()) .setTcpNoDelay(in.readBoolean()) .setMaxOpenCursorsPerConnection(in.readInt()) .setThreadPoolSize(in.readInt()) .setIdleTimeout(in.readLong()) .setThinClientEnabled(in.readBoolean()) .setOdbcEnabled(in.readBoolean()) .setJdbcEnabled(in.readBoolean()); }