Package py4j

Class CallbackConnection

java.lang.Object
py4j.CallbackConnection
All Implemented Interfaces:
Py4JClientConnection

public class CallbackConnection extends Object implements Py4JClientConnection

Default implementation of the CommunicationChannel interface using TCP sockets.

Author:
Barthelemy Dagenais
  • Field Details

    • DEFAULT_NONBLOCKING_SO_TIMEOUT

      public static final int DEFAULT_NONBLOCKING_SO_TIMEOUT
      See Also:
  • Constructor Details

    • CallbackConnection

      public CallbackConnection(int port, InetAddress address)
    • CallbackConnection

      public CallbackConnection(int port, InetAddress address, SocketFactory socketFactory)
    • CallbackConnection

      public CallbackConnection(int port, InetAddress address, SocketFactory socketFactory, int readTimeout)
      Parameters:
      port - The port used to connect to the Python side.
      address - The address used to connect to the Java side.
      socketFactory - The socket factory used to create a socket (connection) to the Python side.
      readTimeout - Time in milliseconds (0 = infinite). Once connected to the Python side, if the Java side does not receive a response after this time, the connection with the Python program is closed. If readTimeout = 0, a default readTimeout of 1000 is used for operations that must absolutely be non-blocking.
    • CallbackConnection

      public CallbackConnection(int port, InetAddress address, SocketFactory socketFactory, int readTimeout, String authToken)
      Parameters:
      port - The port used to connect to the Python side.
      address - The address used to connect to the Java side.
      socketFactory - The socket factory used to create a socket (connection) to the Python side.
      readTimeout - Time in milliseconds (0 = infinite). Once connected to the Python side, if the Java side does not receive a response after this time, the connection with the Python program is closed. If readTimeout = 0, a default readTimeout of 1000 is used for operations that must absolutely be non-blocking.
      authToken - Token for authenticating with the callback server.
  • Method Details