@Override public Socket createSocket(String host, int port) throws IOException { return this.sc.connectForClient(host, port, this.logger, 0/*no timeout*/); } };
@Override public Socket createSocket(String host, int port) throws IOException { return this.sc.connectForClient(host, port, 0/* no timeout */); } };
/** not actually related to this test class, but this is as good a place as any for this little test of the client-side ability to tell gemfire to use a given socket factory. We just test the connectForClient method to see if it's used */ public void testClientSocketFactory() { System.getProperties().put("gemfire.clientSocketFactory", TSocketFactory.class.getName()); System.getProperties().remove( "gemfire.ssl-enabled"); SocketCreator.getDefaultInstance(new Properties()); factoryInvoked = false; try { try { Socket sock = SocketCreator.getDefaultInstance().connectForClient("localhost", 12345, new LocalLogWriter(LogWriterImpl.ALL_LEVEL, System.out),0); sock.close(); fail("socket factory was not invoked"); } catch (IOException e) { assertTrue("socket factory was not invoked: " + factoryInvoked, factoryInvoked); } } finally { System.getProperties().remove("gemfire.clientSocketFactory"); SocketCreator.getDefaultInstance().initializeClientSocketFactory(); } }
int handShakeTimeout, int readTimeout, byte communicationMode, GatewaySender sender, SocketCreator sc) throws IOException { theSocket = sc.connectForClient( location.getHostName(), location.getPort(), handShakeTimeout, socketBufferSize); theSocket.setTcpNoDelay(true);
throw new NoRouteToHostException("Server is not reachable: " + location.getHostName()); theSocket = sc.connectForClient( location.getHostName(), location.getPort(), logger, handShakeTimeout, socketBufferSize); theSocket.setTcpNoDelay(true);
"BridgeServer.SOCKET_BUFFER_SIZE", 32768).intValue(); mySock = socketCreator.connectForClient( location.getHostName(), location.getPort(), handshakeTimeout, socketBufferSize); mySock.setTcpNoDelay(true);
mySock = SocketCreator.getDefaultInstance().connectForClient( location.getHostName(), location.getPort(), logger, handshakeTimeout, socketBufferSize); mySock.setTcpNoDelay(true);