/** * Sets the socket buffer size for each connection made in this pool. Large messages can be * received and sent faster when this buffer is larger. Larger buffers also optimize the rate at * which servers can send events for client subscriptions. * * @param bufferSize the size of the socket buffers used for reading and writing on each * connection in this pool. * @return a reference to <code>this</code> * @throws IllegalArgumentException if <code>bufferSize</code> is less than or equal to * <code>0</code>. */ public ClientCacheFactory setPoolSocketBufferSize(int bufferSize) { getPoolFactory().setSocketBufferSize(bufferSize); return this; }
f.setSocketBufferSize(parseInt(v));
PoolFactory poolFactory = PoolManager.createFactory(); addServers(poolFactory, h, ports).setSubscriptionEnabled(true).setThreadLocalConnections(true) .setReadTimeout(5000).setSocketBufferSize(32768).setMinConnections(3) .setSubscriptionRedundancy(1).setPingInterval(2000);
void createClientCacheAndVerifyPingIntervalIsSet(String host, int port) throws Exception { PoolImpl pool = null; try { Properties props = new Properties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, ""); createCache(props); pool = (PoolImpl) PoolManager.createFactory().addServer(host, port) .setSubscriptionEnabled(true).setThreadLocalConnections(false).setReadTimeout(1000) .setSocketBufferSize(32768).setMinConnections(1).setSubscriptionRedundancy(-1) .setPingInterval(2000).create("test pool"); Region<Object, Object> region = cache.createRegionFactory(RegionShortcut.LOCAL) .setPoolName("test pool").create(REGION_NAME1); region.registerInterest(".*"); /** get the subscription connection and verify that it has the correct timeout setting */ QueueConnectionImpl primaryConnection = (QueueConnectionImpl) pool.getPrimaryConnection(); int pingInterval = ((CacheClientUpdater) primaryConnection.getUpdater()) .getServerQueueStatus().getPingInterval(); assertNotEquals(0, pingInterval); assertEquals(CacheClientNotifier.getClientPingInterval(), pingInterval); } finally { cache.close(); } }
PoolImpl p = (PoolImpl) PoolManager.createFactory().addServer(host, PORT1).setSubscriptionEnabled(true) .setThreadLocalConnections(true).setReadTimeout(1000).setSocketBufferSize(32768) .setMinConnections(3).setSubscriptionRedundancy(-1).setPingInterval(2000)
.thenAnswer(newSetter(serverGroup, mockPoolFactory)); when(mockPoolFactory.setSocketBufferSize(anyInt())) .thenAnswer(newSetter(socketBufferSize, mockPoolFactory));
mockPoolFactory.setSocketBufferSize(invocation.getArgument(0)); return clientCacheFactorySpy; }).when(clientCacheFactorySpy).setPoolSocketBufferSize(anyInt());
it.setRetryAttempts(this.retryAttempts); it.setServerGroup(this.serverGroup); it.setSocketBufferSize(this.socketBufferSize); it.setSocketConnectTimeout(this.socketConnectTimeout); it.setStatisticInterval(this.statisticInterval);
it.setRetryAttempts(this.retryAttempts); it.setServerGroup(this.serverGroup); it.setSocketBufferSize(this.socketBufferSize); it.setSocketConnectTimeout(this.socketConnectTimeout); it.setStatisticInterval(this.statisticInterval);