private void initClientServer() { this.clientServer = new ClientServer(port, GatewayServer.defaultAddress(), pythonPort, GatewayServer.defaultAddress(), GatewayServer.DEFAULT_CONNECT_TIMEOUT, GatewayServer.DEFAULT_READ_TIMEOUT, ServerSocketFactory.getDefault(), SocketFactory.getDefault(), null); }
public CallbackClient(int port) { this(port, GatewayServer.defaultAddress(), DEFAULT_MIN_CONNECTION_TIME, DEFAULT_MIN_CONNECTION_TIME_UNIT, SocketFactory.getDefault(), true); }
/** * * @param entryPoint */ public ClientServer(Object entryPoint) { this(GatewayServer.DEFAULT_PORT, GatewayServer.defaultAddress(), GatewayServer.DEFAULT_PYTHON_PORT, GatewayServer.defaultAddress(), GatewayServer.DEFAULT_CONNECT_TIMEOUT, GatewayServer.DEFAULT_READ_TIMEOUT, ServerSocketFactory.getDefault(), SocketFactory.getDefault(), entryPoint); }
public ClientServerBuilder(Object entryPoint) { javaPort = GatewayServer.DEFAULT_PORT; javaAddress = GatewayServer.defaultAddress(); pythonPort = GatewayServer.DEFAULT_PYTHON_PORT; pythonAddress = GatewayServer.defaultAddress(); connectTimeout = GatewayServer.DEFAULT_CONNECT_TIMEOUT; readTimeout = GatewayServer.DEFAULT_READ_TIMEOUT; serverSocketFactory = ServerSocketFactory.getDefault(); socketFactory = SocketFactory.getDefault(); this.entryPoint = entryPoint; autoStartJavaServer = true; enableMemoryManagement = true; }
public GatewayServerBuilder(Object entryPoint) { javaPort = GatewayServer.DEFAULT_PORT; javaAddress = GatewayServer.defaultAddress(); connectTimeout = GatewayServer.DEFAULT_CONNECT_TIMEOUT; readTimeout = GatewayServer.DEFAULT_READ_TIMEOUT; serverSocketFactory = ServerSocketFactory.getDefault(); this.entryPoint = entryPoint; }
/** * * @param entryPoint * The entry point of this Gateway. Can be null. * @param port * The port the GatewayServer is listening to. * @param connectTimeout * Time in milliseconds (0 = infinite). If a GatewayServer does * not receive a connection request after this time, it closes * the server socket and no other connection is accepted. * @param readTimeout * Time in milliseconds (0 = infinite). Once a Python program is * connected, if a GatewayServer does not receive a request * (e.g., a method call) after this time, the connection with the * Python program is closed. * @param customCommands * A list of custom Command classes to augment the Server * features. These commands will be accessible from Python * programs. Can be null. * @param cbClient * An instance of a callback client. */ public GatewayServer(Object entryPoint, int port, int connectTimeout, int readTimeout, List<Class<? extends Command>> customCommands, Py4JPythonClient cbClient) { this(entryPoint, port, defaultAddress(), connectTimeout, readTimeout, customCommands, cbClient, ServerSocketFactory.getDefault()); }
/** * * @param entryPoint * The entry point of this Gateway. Can be null. * @param port * The port the GatewayServer is listening to. * @param pythonPort * The port used by a PythonProxyHandler to connect to a Python * gateway. Essentially the port used for Python callbacks. * @param connectTimeout * Time in milliseconds (0 = infinite). If a GatewayServer does * not receive a connection request after this time, it closes * the server socket and no other connection is accepted. * @param readTimeout * Time in milliseconds (0 = infinite). Once a Python program is * connected, if a GatewayServer does not receive a request * (e.g., a method call) after this time, the connection with the * Python program is closed. * @param customCommands * A list of custom Command classes to augment the Server * features. These commands will be accessible from Python * programs. Can be null. */ public GatewayServer(Object entryPoint, int port, int pythonPort, int connectTimeout, int readTimeout, List<Class<? extends Command>> customCommands) { this(entryPoint, port, defaultAddress(), connectTimeout, readTimeout, customCommands, new CallbackClient(pythonPort, defaultAddress()), ServerSocketFactory.getDefault()); }