cliConnCfg.setPortRange(sqlConnCfg.getPortRange()); cliConnCfg.setSocketSendBufferSize(sqlConnCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(sqlConnCfg.getSocketReceiveBufferSize()); cliConnCfg.setTcpNoDelay(sqlConnCfg.isTcpNoDelay()); cliConnCfg.setThreadPoolSize(sqlConnCfg.getThreadPoolSize()); cliConnCfg.setThreadPoolSize(odbcCfg.getThreadPoolSize()); cliConnCfg.setSocketSendBufferSize(odbcCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(odbcCfg.getSocketReceiveBufferSize()); cliConnCfg.setMaxOpenCursorsPerConnection(odbcCfg.getMaxOpenCursors());
/** * Test socket buffers. * * @throws Exception If failed. */ @Test public void testSocketBuffers() throws Exception { check(new ClientConnectorConfiguration().setSocketSendBufferSize(-4 * 1024), false); check(new ClientConnectorConfiguration().setSocketReceiveBufferSize(-4 * 1024), false); check(new ClientConnectorConfiguration().setSocketSendBufferSize(4 * 1024), true); checkJdbc(null, ClientConnectorConfiguration.DFLT_PORT); check(new ClientConnectorConfiguration().setSocketReceiveBufferSize(4 * 1024), true); checkJdbc(null, ClientConnectorConfiguration.DFLT_PORT + 1); }
/** * 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.setPortRange(sqlConnCfg.getPortRange()); cliConnCfg.setSocketSendBufferSize(sqlConnCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(sqlConnCfg.getSocketReceiveBufferSize()); cliConnCfg.setTcpNoDelay(sqlConnCfg.isTcpNoDelay()); cliConnCfg.setThreadPoolSize(sqlConnCfg.getThreadPoolSize()); cliConnCfg.setThreadPoolSize(odbcCfg.getThreadPoolSize()); cliConnCfg.setSocketSendBufferSize(odbcCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(odbcCfg.getSocketReceiveBufferSize()); cliConnCfg.setMaxOpenCursorsPerConnection(odbcCfg.getMaxOpenCursors());
/** * 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()); }