public class CallbackConnection extends java.lang.Object implements Py4JClientConnection
Default implementation of the CommunicationChannel interface using TCP sockets.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NONBLOCKING_SO_TIMEOUT |
Constructor and Description |
---|
CallbackConnection(int port,
java.net.InetAddress address) |
CallbackConnection(int port,
java.net.InetAddress address,
javax.net.SocketFactory socketFactory) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
readBlockingResponse(java.io.BufferedReader reader) |
protected java.lang.String |
readNonBlockingResponse(java.net.Socket socket,
java.io.BufferedReader reader) |
java.lang.String |
sendCommand(java.lang.String command) |
java.lang.String |
sendCommand(java.lang.String command,
boolean blocking) |
void |
setUsed(boolean used) |
void |
shutdown() |
void |
start() |
boolean |
wasUsed() |
public static final int DEFAULT_NONBLOCKING_SO_TIMEOUT
public CallbackConnection(int port, java.net.InetAddress address)
public CallbackConnection(int port, java.net.InetAddress address, javax.net.SocketFactory socketFactory)
public java.lang.String sendCommand(java.lang.String command)
sendCommand
in interface Py4JClientConnection
public java.lang.String sendCommand(java.lang.String command, boolean blocking)
sendCommand
in interface Py4JClientConnection
protected java.lang.String readBlockingResponse(java.io.BufferedReader reader) throws java.io.IOException
java.io.IOException
protected java.lang.String readNonBlockingResponse(java.net.Socket socket, java.io.BufferedReader reader) throws java.io.IOException
java.io.IOException
public void setUsed(boolean used)
setUsed
in interface Py4JClientConnection
public void shutdown()
shutdown
in interface Py4JClientConnection
public void start() throws java.io.IOException
start
in interface Py4JClientConnection
java.io.IOException
public boolean wasUsed()
wasUsed
in interface Py4JClientConnection